lib/thinking_sphinx/railtie.rb in thinking-sphinx-3.1.2 vs lib/thinking_sphinx/railtie.rb in thinking-sphinx-3.1.3
- old
+ new
@@ -1,7 +1,9 @@
class ThinkingSphinx::Railtie < Rails::Railtie
- ActiveSupport.on_load :active_record do
- include ThinkingSphinx::ActiveRecord::Base
+ initializer 'thinking_sphinx.initialisation' do
+ if defined?(ActiveRecord::Base)
+ ActiveRecord::Base.send :include, ThinkingSphinx::ActiveRecord::Base
+ end
end
rake_tasks do
load File.expand_path('../tasks.rb', __FILE__)
end