tracks/app/models/tag.rb
2008-05-20 21:28:26 +01:00

11 lines
No EOL
300 B
Ruby

class Tag < ActiveRecord::Base
has_many_polymorphs :taggables,
:from => [:todos],
:through => :taggings,
:dependent => :destroy
def on(taggable, user)
tagging = taggings.create :taggable => taggable, :user => user
end
end