Newer
Older
# == Schema Information
#
# Table name: bookmarks
#
# id :integer not null, primary key
# user_id :integer
# bookmarkable_id :integer
# bookmarkable_type :string
# created_at :datetime not null
# updated_at :datetime not null
#
# Example of Trackable:
# *current_user* create bookmark *bookmarkable*
belongs_to :user, counter_cache: true
belongs_to :bookmarkable, polymorphic: true
validates_presence_of :user, :bookmarkable
validates :user_id, uniqueness: { scope: [:bookmarkable_id, :bookmarkable_type] }

Israel Barreto Sant'Anna
committed
def recipient
bookmarkable
end