lib/elasticsearch_autocomplete/railtie.rb in elasticsearch_autocomplete-0.1.2 vs lib/elasticsearch_autocomplete/railtie.rb in elasticsearch_autocomplete-0.1.3
- old
+ new
@@ -1,9 +1,15 @@
module ElasticsearchAutocomplete
class Railtie < Rails::Railtie
initializer 'elasticsearch_autocomplete.model_additions' do
+
+ ActiveSupport.on_load :mongoid do
+ const_get(:ClassMethods).send :include, ElasticsearchAutocomplete::ModelAddition::SingletonMethods
+ end
+
ActiveSupport.on_load :active_record do
include ElasticsearchAutocomplete::ModelAddition
end
+
end
end
end
\ No newline at end of file