Browse Source

Lint offences

pull/2605/head
Manny Dinssa 2 years ago
parent
commit
8dabdd1ff0
  1. 4
      app/models/location.rb
  2. 2
      app/models/scheme.rb

4
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: joins(scheme: [:owning_organisation]).merge(Location.deactivated_by_organisation).pluck(:id))
.where.not(id: incomplete.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(: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)) .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: joins(scheme: [:owning_organisation]).merge(Location.deactivated_by_organisation).pluck(:id))
.where.not(id: incomplete.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(: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)) .where.not(id: activating_soon(date).pluck(:id))
} }

2
app/models/scheme.rb

@ -68,7 +68,7 @@ class Scheme < ApplicationRecord
scope :deactivating_soon, lambda { |date = Time.zone.now| scope :deactivating_soon, lambda { |date = Time.zone.now|
merge(SchemeDeactivationPeriod.deactivations_without_reactivation) 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)) .where.not(id: joins(:owning_organisation).deactivated_by_organisation.pluck(:id))
} }

Loading…
Cancel
Save