diff --git a/app/models/budget.rb b/app/models/budget.rb index 8d6023fcb..614d124c0 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -55,6 +55,7 @@ class Budget < ApplicationRecord scope :reviewing_ballots, -> { where(phase: "reviewing_ballots") } scope :finished, -> { where(phase: "finished") } + class << self; undef :open; end scope :open, -> { where.not(phase: "finished") } def self.current diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index c07edadd6..443994506 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -54,6 +54,7 @@ class Legislation::Process < ApplicationRecord validates :background_color, format: { allow_blank: true, with: CSS_HEX_COLOR } validates :font_color, format: { allow_blank: true, with: CSS_HEX_COLOR } + class << self; undef :open; end scope :open, -> { where("start_date <= ? and end_date >= ?", Date.current, Date.current) } scope :active, -> { where("end_date >= ?", Date.current) } scope :past, -> { where("end_date < ?", Date.current) }