diff --git a/generators/tagging/templates/tagging_extensions.rb b/generators/tagging/templates/tagging_extensions.rb index 280aa3c..61c692a 100644 --- a/generators/tagging/templates/tagging_extensions.rb +++ b/generators/tagging/templates/tagging_extensions.rb @@ -1,4 +1,3 @@ - class ActiveRecord::Base #:nodoc: # These extensions make models taggable. This file is automatically generated and required by your app if you run the tagging generator included with has_many_polymorphs. @@ -13,7 +12,7 @@ def _add_tags incoming begin tag = Tag.find_or_create_by_name(tag_name) raise Tag::Error, "tag could not be saved: #{tag_name}" if tag.new_record? - tag.taggables << self + tags << tag rescue ActiveRecord::StatementInvalid => e raise unless e.to_s =~ /duplicate/i end @@ -66,7 +65,11 @@ def tag_list #:nodoc: <%= parent_association_name -%>s.to_s #:startdoc: end - + + def tag_list=(value) + tag_with(value) + end + private def tag_cast_to_string obj #:nodoc: