belongs_to :x, class_name: Class -> String

This commit is contained in:
Petko Bordjukov 2019-04-28 02:32:08 +03:00
parent e0abfa5253
commit 32b1b1c458
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
class Participation < ActiveRecord::Base class Participation < ActiveRecord::Base
belongs_to :participant, class_name: User belongs_to :participant, class_name: 'User'
has_one :participant_with_personal_profile, class_name: Participant has_one :participant_with_personal_profile, class_name: 'Participant'
belongs_to :event belongs_to :event
validates :participant_id, presence: true validates :participant_id, presence: true
scope :approved, ->() { where approved: true } scope :approved, ->() { where approved: true }