2020-07-18 00:04:09 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Just an example, to be replaced with an actual implementation
|
|
|
|
module MyModuleStatusConditions
|
|
|
|
class Active < MyModuleStatusCondition
|
|
|
|
def call(my_module)
|
2020-09-09 14:50:24 +08:00
|
|
|
my_module.errors.add(:status_conditions, I18n.t('my_module_statuses.conditions.error.my_module_not_active')) unless my_module.active?
|
2020-07-18 00:04:09 +08:00
|
|
|
end
|
2020-09-07 20:44:47 +08:00
|
|
|
|
|
|
|
def description
|
2020-09-09 14:50:24 +08:00
|
|
|
I18n.t('my_module_statuses.conditions.error.my_module_not_active')
|
2020-09-07 20:44:47 +08:00
|
|
|
end
|
2020-07-18 00:04:09 +08:00
|
|
|
end
|
|
|
|
end
|