Skip to content
Snippets Groups Projects
Commit ae8d5600 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Create paricipants model

parent 52224940
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -17,6 +17,7 @@ module Issuable
has_many :label_links, as: :target, dependent: :destroy
has_many :labels, through: :label_links
has_many :subscriptions, dependent: :destroy, as: :subscribable
# has_many :participants, dependent: :destroy, as: :target
 
validates :author, presence: true
validates :title, presence: true, length: { within: 0..255 }
Loading
Loading
class Participant < ActiveRecord::Base
belongs_to :user
belongs_to :target, polymorphic: true
validates :user_id,
uniqueness: { scope: [:target_id, :target_type] },
presence: true
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment