-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assign and initialize Spree::Config earlier, before rails initializers #2178
Conversation
if !value || | ||
value == 0 || | ||
value =~ /\A(f|false|0)\Z/i || | ||
(value.respond_to?(:empty?) && value.empty?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the operands of a condition in an if statement spanning multiple lines.
when :boolean | ||
if !value || | ||
value == 0 || | ||
value =~ /\A(f|false|0)\Z/i || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the operands of a condition in an if statement spanning multiple lines.
value.to_i | ||
when :boolean | ||
if !value || | ||
value == 0 || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the operands of a condition in an if statement spanning multiple lines.
Use value.zero? instead of value == 0.
if !value || | ||
value == 0 || | ||
value =~ /\A(f|false|0)\Z/i || | ||
(value.respond_to?(:empty?) && value.empty?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the operands of a condition in an if statement spanning multiple lines.
when :boolean | ||
if !value || | ||
value == 0 || | ||
value =~ /\A(f|false|0)\Z/i || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the operands of a condition in an if statement spanning multiple lines.
value.to_i | ||
when :boolean | ||
if !value || | ||
value == 0 || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the operands of a condition in an if statement spanning multiple lines.
Use value.zero? instead of value == 0.
b80e4be
to
9abe73a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm alright with this.
Nothing in preferences needs to be in /app, as nothing relies on rails anymore
This allows apps to require spree/config earlier in their startup and access the configuration before its set by the rails environment.
Nothing in here requires rails to exist, so it can live in /lib just as easily as /app/models
With the previous commit I can now require this at the top
1a0952c
to
72cc52a
Compare
This reflects the current structure of the filesystem since that class' file has been moved from /app to /lib with solidusio#2178
This moves preferences out of /app into /lib, as nothing in here should require rails to run.
It also moves the initialization of the Spree::Config instance to be in the spree/config file, better allowing applications to control when this is available.