mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
11 lines
No EOL
318 B
Ruby
11 lines
No EOL
318 B
Ruby
class Tag < ActiveRecord::Base
|
|
has_many_polymorphs :taggables,
|
|
:from => [:todos, :recurring_todos],
|
|
:through => :taggings,
|
|
:dependent => :destroy
|
|
|
|
def on(taggable, user)
|
|
tagging = taggings.create :taggable => taggable, :user => user
|
|
end
|
|
|
|
end |