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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move api_configuration from /app to /lib
It has nothing to do with Rails anymore and follows the style
of what we do in core
  • Loading branch information
kennyadsl committed Jul 18, 2019
commit fbc8d6b49c6181abfc92ae787ca8895087148973
9 changes: 9 additions & 0 deletions api/lib/spree/api/config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

require 'spree/api_configuration'

module Spree
module Api
Config = Spree::ApiConfiguration.new
end
end
7 changes: 4 additions & 3 deletions api/lib/spree/api/engine.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# frozen_string_literal: true

require 'rails/engine'
require 'spree/api/config'

module Spree
module Api
class Engine < Rails::Engine
isolate_namespace Spree
engine_name 'spree_api'

initializer "spree.api.environment", before: :load_config_initializers do |_app|
Spree::Api::Config = Spree::ApiConfiguration.new
end
# Leave initializer empty for backwards-compatability. Other apps
# might still rely on this event.
initializer "spree.api.environment", before: :load_config_initializers do; end
end
end
end