Skip to content

Commit

Permalink
Merge pull request #11 from solidusio-contrib/duplicated_permitted_at…
Browse files Browse the repository at this point in the history
…tributes

Only load permitted attributes once
  • Loading branch information
qr8r authored May 29, 2017
2 parents dd0d16b + c61f4d6 commit 0c5e587
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/solidus_subscriptions/engine.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module SolidusSubscriptions
class Engine < Rails::Engine
require 'spree/core'
require 'solidus_subscriptions/permitted_attributes'
require 'solidus_subscriptions/config'
require 'solidus_subscriptions/processor'

isolate_namespace SolidusSubscriptions
engine_name 'solidus_subscriptions'
Expand All @@ -11,10 +14,12 @@ class Engine < Rails::Engine
end

config.autoload_paths << config.root.join('app', 'jobs')
config.autoload_paths << config.root.join('lib')

initializer 'solidus_subscriptions.configs', before: "spree.register.payment_methods" do
require 'solidus_subscriptions/config'
initializer 'configure spree subcription permitted attributes', after: 'require subscription lib helpers' do
PermittedAttributes.update_spree_permiteed_attributes
end

initializer 'solidus_subscriptions.configs', before: "require subscription lib helpers" do
end

initializer 'register_subscription_promotion_rule', after: 'spree.promo.register.promotion.rules' do |app|
Expand All @@ -39,7 +44,6 @@ def self.activate
end

Spree::Ability.register_ability(SolidusSubscriptions::Ability)
PermittedAttributes.update_spree_permiteed_attributes
end

config.to_prepare(&method(:activate).to_proc)
Expand Down

0 comments on commit 0c5e587

Please sign in to comment.