Update to rails 5.2.2.1
This commit is contained in:
parent
1f30bb8a2f
commit
446808da96
36 changed files with 425 additions and 291 deletions
|
|
@ -11,11 +11,6 @@ class User < ApplicationRecord
|
|||
# prevent N+1 queries with has_cached_role? by preloading roles *always*
|
||||
default_scope { preload(:roles) }
|
||||
|
||||
has_many :physical_tickets, through: :ticket_purchases do
|
||||
def by_conference(conference)
|
||||
where('ticket_purchases.conference_id = ?', conference)
|
||||
end
|
||||
end
|
||||
has_many :users_roles
|
||||
has_many :roles, through: :users_roles, dependent: :destroy
|
||||
|
||||
|
|
@ -74,6 +69,11 @@ class User < ApplicationRecord
|
|||
where(conference: conference, registration_ticket: true).first
|
||||
end
|
||||
end
|
||||
has_many :physical_tickets, through: :ticket_purchases do
|
||||
def by_conference(conference)
|
||||
where('ticket_purchases.conference_id = ?', conference)
|
||||
end
|
||||
end
|
||||
has_many :votes, dependent: :destroy
|
||||
has_many :voted_events, through: :votes, source: :events
|
||||
has_many :subscriptions, dependent: :destroy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue