diff --git a/app/models/application_record.rb b/app/models/application_record.rb index ca22338d5d..e4478b1559 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -2,6 +2,7 @@ class ApplicationRecord < ActiveRecord::Base include DelegateBelongsTo + include Spree::Core::Permalinks include Spree::Preferences::Preferable self.abstract_class = true diff --git a/lib/spree/core/permalinks.rb b/lib/spree/core/permalinks.rb index b9d8a83274..b667de7b2c 100644 --- a/lib/spree/core/permalinks.rb +++ b/lib/spree/core/permalinks.rb @@ -23,14 +23,6 @@ module Spree before_validation(on: :create) { save_permalink } end - def find_by_param(value, *args) - __send__("find_by_#{permalink_field}", value, *args) - end - - def find_by_param!(value, *args) - __send__("find_by_#{permalink_field}!", value, *args) - end - def permalink_field permalink_options[:field] end @@ -70,6 +62,3 @@ module Spree end end end - -ActiveRecord::Base.include(Spree::Core::Permalinks) -ActiveRecord::Relation.include(Spree::Core::Permalinks)