search for: tag_cast_to_string

Displaying 1 result from an estimated 1 matches for "tag_cast_to_string".

2007 Nov 29
0
has_many_polymorphs for user owned tags
...the Tagging model. So I changed the index in the generated migration, and added user_id to the taggings table. Then I added belongs_to :user in the Tagging model. In the lib/tagging_extensions.rb file I added a new function: def _add_tags_from_user incoming, user taggable?(true) tag_cast_to_string(incoming).each do |tag_name| begin tag = Tag.find_or_create_by_name(tag_name) raise Tag::Error, "tag could not be saved: #{tag_name}" if tag.new_record? Tagging.create(:tag => tag, :taggable => self, :user_id => user.id) rescue Active...