search for: tagging_extensions

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

2007 Nov 29
0
has_many_polymorphs for user owned tags
...to extend the tagging functionality of has_many_polymorphs to work with user owned tags - ie, putting belongs_to :user in 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 t...