diff --git a/app/models/conference.rb b/app/models/conference.rb index 8f306380..2e63e4ee 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -9,8 +9,8 @@ class Conference < ApplicationRecord resourcify :roles, dependent: :delete_all default_scope { order('start_date DESC') } - scope :upcoming, (-> { where('end_date >= ?', Date.current) }) - scope :past, (-> { where('end_date < ?', Date.current) }) + scope :upcoming, (-> { where(end_date: Date.current..) }) + scope :past, (-> { where(end_date: ...Date.current) }) has_paper_trail ignore: %i(updated_at guid revision events_per_week), meta: { conference_id: :id } diff --git a/app/models/user.rb b/app/models/user.rb index 993d4892..dace4655 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -44,7 +44,7 @@ class User < ApplicationRecord where('last_sign_in_at > ?', Date.today - 3.months).where(is_disabled: false) } scope :unconfirmed, -> { where('confirmed_at IS NULL') } - scope :dead, -> { where('last_sign_in_at < ?', Date.today - 1.year) } + scope :dead, -> { where(last_sign_in_at: ...(Date.today - 1.year)) } # Include default devise modules. Others available are: # :token_authenticatable, :confirmable,