You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working through the setup instructions, after installing the gem and running the migrations, I'm getting the following error when attempting to start my application:
undefined local variable or method `default_environment' for Spree::AvataxConfiguration:Class (NameError)
I've created an initializer that looks like the following:
But from what I can tell, the problem seems to be that Spree::AvataxConfiguration is attempting to call default_environment as a class method, when it is defined as an instance method. Am I misunderstanding something here?
I'm using Solidus 3.1.4, Ruby 3.0, and Rails 6.1.4.4.
The text was updated successfully, but these errors were encountered:
I suspect this may have been a change in behavior in Solidus 3.1, based on the warning messages I'm seeing. I guess the question is whether this gem is intending to support 3.1+, and if so, how we'd have to change this proc.
DEPRECATION WARNING: The arity of a proc given as the default for a preference
has changed from 0 to 1 on Solidus 3.1. The Solidus
version for the loaded preference defaults is given as the
proc's argument from this point on.
If you don't need to return a different default value
depending on the loaded Solidus version, you can change
the proc so that it doesn't have lambda semantics (lambdas
raise when extra arguments are supplied, while raw procs
don't). E.g.:
preference :foo, :string, default: proc { true }
If you want to branch on the provided Solidus version, you can do like the following:
preference :foo, :string, default: by_version(true, "3.2.0" => false)
When working through the setup instructions, after installing the gem and running the migrations, I'm getting the following error when attempting to start my application:
I've created an initializer that looks like the following:
But from what I can tell, the problem seems to be that
Spree::AvataxConfiguration
is attempting to calldefault_environment
as a class method, when it is defined as an instance method. Am I misunderstanding something here?I'm using Solidus 3.1.4, Ruby 3.0, and Rails 6.1.4.4.
The text was updated successfully, but these errors were encountered: