10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/acts_as_taggable_on/taggable/dirty.rb', line 10
def initialize_acts_as_taggable_on_dirty
tag_types.map(&:to_s).each do |tags_type|
tag_type = tags_type.to_s.singularize
class_eval "def \#{tag_type}_list_changed?\nchanged_attributes.include?(\"\#{tag_type}_list\")\nend\n\ndef \#{tag_type}_list_was\nchanged_attributes.include?(\"\#{tag_type}_list\") ? changed_attributes[\"\#{tag_type}_list\"] : __send__(\"\#{tag_type}_list\")\nend\n\ndef \#{tag_type}_list_change\n[changed_attributes['\#{tag_type}_list'], __send__('\#{tag_type}_list')] if changed_attributes.include?(\"\#{tag_type}_list\")\nend\n\ndef \#{tag_type}_list_changes\n[changed_attributes['\#{tag_type}_list'], __send__('\#{tag_type}_list')] if changed_attributes.include?(\"\#{tag_type}_list\")\nend\n", __FILE__, __LINE__ + 1
end
end
|