Skip to content

Commit

Permalink
Use better ActiveRecord hook - fixes ankane#910
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Apr 30, 2017
1 parent 00c7807 commit 1fb35cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/searchkick.rb
Expand Up @@ -207,4 +207,7 @@ def self.callbacks_value=(value)

# TODO find better ActiveModel hook
ActiveModel::Callbacks.send(:include, Searchkick::Model)
ActiveRecord::Base.send(:extend, Searchkick::Model) if defined?(ActiveRecord)

ActiveSupport.on_load(:active_record) do
extend Searchkick::Model
end

0 comments on commit 1fb35cc

Please sign in to comment.