Send to both Phase and Publication classes the enabled flag and use for enabled? helper method

This commit is contained in:
Bertocq
2017-06-13 23:47:14 +02:00
parent bae9d105fa
commit cb7358bb97
3 changed files with 12 additions and 8 deletions

View File

@@ -2,13 +2,14 @@
class Legislation::Process::Phase
def initialize(start_date, end_date)
def initialize(start_date, end_date, enabled)
@start_date = start_date
@end_date = end_date
@enabled = enabled
end
def enabled?
@start_date.present? && @end_date.present?
@enabled
end
def started?