diff --git a/app/models/location.rb b/app/models/location.rb index 8ef6b1715..93bc2ff7d 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -103,7 +103,7 @@ class Location < ApplicationRecord .where.not(id: joins(scheme: [:owning_organisation]).merge(Location.deactivated_by_organisation).pluck(:id)) .where.not(id: incomplete.pluck(:id)) .where.not(id: joins(:location_deactivation_periods).merge(Location.deactivating_soon_directly).pluck(:id)) - .where.not(id: joins(scheme: [:owning_organisation, :scheme_deactivation_periods]).merge(Location.deactivating_soon_by_scheme).pluck(:id)) + .where.not(id: joins(scheme: %i[owning_organisation scheme_deactivation_periods]).merge(Location.deactivating_soon_by_scheme).pluck(:id)) .where.not(id: activating_soon.pluck(:id)) } @@ -114,7 +114,7 @@ class Location < ApplicationRecord .where.not(id: joins(scheme: [:owning_organisation]).merge(Location.deactivated_by_organisation).pluck(:id)) .where.not(id: incomplete.pluck(:id)) .where.not(id: joins(:location_deactivation_periods).merge(Location.deactivating_soon_directly(date)).pluck(:id)) - .where.not(id: joins(scheme: [:owning_organisation, :scheme_deactivation_periods]).merge(Location.deactivating_soon_by_scheme(date)).pluck(:id)) + .where.not(id: joins(scheme: %i[owning_organisation scheme_deactivation_periods]).merge(Location.deactivating_soon_by_scheme(date)).pluck(:id)) .where.not(id: activating_soon(date).pluck(:id)) } diff --git a/app/models/scheme.rb b/app/models/scheme.rb index 392a9458c..824efc6ee 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -68,7 +68,7 @@ class Scheme < ApplicationRecord scope :deactivating_soon, lambda { |date = Time.zone.now| merge(SchemeDeactivationPeriod.deactivations_without_reactivation) - .where("scheme_deactivation_periods.deactivation_date > ? AND scheme_deactivation_periods.deactivation_date < ? ", date, 6.months.from_now) + .where("scheme_deactivation_periods.deactivation_date > ? AND scheme_deactivation_periods.deactivation_date < ? ", date, 6.months.from_now) .where.not(id: joins(:owning_organisation).deactivated_by_organisation.pluck(:id)) }