Use distinct instead of uniq because deprectation.
This commit is contained in:
parent
83053f4626
commit
57e596c67e
1 changed files with 2 additions and 2 deletions
|
|
@ -45,8 +45,8 @@ class User < ApplicationRecord
|
|||
attr_accessor :login
|
||||
|
||||
has_many :event_users, dependent: :destroy
|
||||
has_many :events, -> { uniq }, through: :event_users
|
||||
has_many :presented_events, -> { joins(:event_users).where(event_users: {event_role: 'speaker'}).uniq }, through: :event_users, source: :event
|
||||
has_many :events, -> { distinct }, through: :event_users
|
||||
has_many :presented_events, -> { joins(:event_users).where(event_users: {event_role: 'speaker'}).distinct }, through: :event_users, source: :event
|
||||
has_many :registrations, dependent: :destroy do
|
||||
def for_conference conference
|
||||
where(conference: conference).first
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue