Forked from
PortalMEC / portalmec
1205 commits behind the upstream repository.
-
Israel Barreto Sant'Anna authored
Signed-off-by:
Israel Barreto Sant'Anna <ibsa14@inf.ufpr.br>
Israel Barreto Sant'Anna authoredSigned-off-by:
Israel Barreto Sant'Anna <ibsa14@inf.ufpr.br>
share.rb 540 B
# == Schema Information
#
# Table name: shares
#
# id :integer not null, primary key
# shareable_id :integer
# shareable_type :string
# user_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Share < ApplicationRecord
# *current_user* shares *shareable*
include Trackable
belongs_to :shareable, polymorphic: true, counter_cache: true
belongs_to :user
validates_presence_of :user, :shareable
def recipient
shareable
end
end