acts_as_fulltextable 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/acts_as_fulltextable.rb +2 -10
- data/lib/acts_as_fulltextable/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -13,7 +13,7 @@ It has been tested on Rails 3.1+. Ruby 1.9.1+.
|
|
13
13
|
|
14
14
|
Add this line to your application's Gemfile:
|
15
15
|
|
16
|
-
gem 'acts_as_fulltextable'
|
16
|
+
gem 'acts_as_fulltextable', '~> 0.1'
|
17
17
|
|
18
18
|
And then execute:
|
19
19
|
|
@@ -21,7 +21,7 @@ And then execute:
|
|
21
21
|
|
22
22
|
Or install it yourself as:
|
23
23
|
|
24
|
-
$ gem
|
24
|
+
$ gem install acts_as_fulltextable
|
25
25
|
|
26
26
|
|
27
27
|
## Usage
|
data/lib/acts_as_fulltextable.rb
CHANGED
@@ -16,13 +16,10 @@ module ActsAsFulltextable
|
|
16
16
|
# add/update the FullTextRow. A record returning false that is already in FullTextRow is removed.
|
17
17
|
#
|
18
18
|
def acts_as_fulltextable(*attr_names)
|
19
|
-
|
20
|
-
puts attr_names
|
21
|
-
configuration = { :check_for_changes => true, :parent_id => nil, :conditions => "true" }
|
19
|
+
configuration = { :check_for_changes => true, :parent_id => nil, :conditions => "true" }
|
22
20
|
configuration.update(attr_names.pop) while attr_names.last.is_a?(Hash)
|
23
21
|
configuration[:fields] = attr_names.flatten.uniq.compact
|
24
|
-
|
25
|
-
class_attribute :fulltext_options
|
22
|
+
class_attribute :fulltext_options
|
26
23
|
self.fulltext_options = configuration
|
27
24
|
|
28
25
|
extend FulltextableClassMethods
|
@@ -68,11 +65,6 @@ module ActsAsFulltextable
|
|
68
65
|
# Creates the fulltext_row record for self
|
69
66
|
#
|
70
67
|
def create_fulltext_record
|
71
|
-
puts '=================='
|
72
|
-
puts self.class.to_s
|
73
|
-
puts self.id
|
74
|
-
puts self.fulltext_value
|
75
|
-
puts self.parent_id_value
|
76
68
|
FulltextRow.create(:fulltextable_type => self.class.to_s, :fulltextable_id => self.id, :value => self.fulltext_value, :parent_id => self.parent_id_value) if eval self.class.fulltext_options[:conditions]
|
77
69
|
end
|
78
70
|
|