scinote-web/app/models/my_module_status_conditions/active.rb

15 lines
452 B
Ruby
Raw Normal View History

# 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?
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
end
end