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

Make preferences usage uniform across all Solidus gems #3267

Merged
merged 7 commits into from
Jul 18, 2019

Conversation

kennyadsl
Copy link
Member

Description

With #2178 we moved AppConfiguration in core from app/ to lib/.

This PR continues that work by moving also Backend, Frontend, and API configuration classes from app/ to lib/.

The only important thing, in my opinion, is that we cannot use Rails.application.config.i18n.default_locale anymore, since the Rails application is not been booted yet. Using I18n.default_locale should be the same, and the default should not be used by anyone, since we also have the preference set into the spree.rb initializer template that we inject into the host application.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)

@kennyadsl kennyadsl added Code Review Needed changelog:solidus_core Changes to the solidus_core gem labels Jul 12, 2019
@kennyadsl kennyadsl requested a review from cbrunsdon July 12, 2019 12:01
@kennyadsl kennyadsl self-assigned this Jul 12, 2019
Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thank you @kennyadsl

It has nothing to do with Rails anymore and follows the style
of what we do in core
It has nothing to do with Rails anymore and follows the style
of what we do in core
It has nothing to do with Rails anymore and follows the style
of what we do in core
This is needed because, when these files are loaded, we don't have the
Rails app initialized yet. We are safe since the defaults are also
set in the spree.rb initializer template:

https://github.com/solidusio/solidus/blob/be1534d0d9b57d33e80f8c7f36d0e2efe219ada6/core/lib/generators/spree/install/templates/config/initializers/spree.rb.tt#L71

so everyone should have these preferences set
@kennyadsl kennyadsl force-pushed the kennyadsl/move-preferences-to-lib branch from dd18e61 to d42be43 Compare July 18, 2019 11:45
@kennyadsl kennyadsl merged commit f048178 into solidusio:master Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants