xapor 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/xapor/model_integration.rb +3 -3
- data/xapor.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.12
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module Xapor::ModelIntegration
|
2
2
|
def self.included(base)
|
3
3
|
base.send(:include, Xapor::XapianFuIntegration)
|
4
|
-
if defined?(ActiveRecord) && base.is_a?(ActiveRecord::Base)
|
5
|
-
base.after_save :add_to_index
|
6
|
-
end
|
7
4
|
end
|
8
5
|
end
|
9
6
|
|
@@ -49,6 +46,9 @@ module Xapor::XapianFuIntegration
|
|
49
46
|
@config.search_fields.each do |field|
|
50
47
|
class_eval("def self.search_by_#{field}(query)\nself.search(query)\nend")
|
51
48
|
end
|
49
|
+
if defined? ActiveRecord && ancestors.includes(ActiveRecord::Base)
|
50
|
+
class_eval("after_save :add_to_index")
|
51
|
+
end
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
data/xapor.gemspec
CHANGED