Update to rails 5.2.2.1

This commit is contained in:
Henne Vogelsang 2019-03-26 21:03:23 +01:00
parent 1f30bb8a2f
commit 446808da96
No known key found for this signature in database
GPG key ID: 9D6164C2955FADE0
36 changed files with 425 additions and 291 deletions

View file

@ -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