Skip to content
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

Merged
merged 5 commits into from
Aug 30, 2017

Conversation

cbrunsdon
Copy link
Contributor

@cbrunsdon cbrunsdon commented Aug 23, 2017

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.

if !value ||
value == 0 ||
value =~ /\A(f|false|0)\Z/i ||
(value.respond_to?(:empty?) && value.empty?)

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 ||

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 ||

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?)

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 ||

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 ||

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.

Copy link
Member

@gmacdougall gmacdougall left a 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.

Clarke Brunsdon added 5 commits August 30, 2017 10:00
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
@cbrunsdon cbrunsdon force-pushed the early_config branch 2 times, most recently from 1a0952c to 72cc52a Compare August 30, 2017 17:03
@jhawthorn jhawthorn merged commit d00f699 into solidusio:master Aug 30, 2017
@jhawthorn jhawthorn changed the title Move preferences to /lib Assign and initialize Spree::Config earlier, before rails initializers Oct 2, 2017
kennyadsl added a commit to nebulab/solidus that referenced this pull request Jun 26, 2019
This reflects the current structure of the filesystem since that
class' file has been moved from /app to /lib with solidusio#2178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants