From 32b1b1c4589a807a08da26625f8155a97e5e62a3 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sun, 28 Apr 2019 02:32:08 +0300 Subject: [PATCH] belongs_to :x, class_name: Class -> String --- app/models/participation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/participation.rb b/app/models/participation.rb index 42531d3..bfd700e 100644 --- a/app/models/participation.rb +++ b/app/models/participation.rb @@ -1,6 +1,6 @@ class Participation < ActiveRecord::Base - belongs_to :participant, class_name: User - has_one :participant_with_personal_profile, class_name: Participant + belongs_to :participant, class_name: 'User' + has_one :participant_with_personal_profile, class_name: 'Participant' belongs_to :event validates :participant_id, presence: true scope :approved, ->() { where approved: true }