mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-28 11:14:24 +08:00
14 lines
452 B
Ruby
14 lines
452 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Just an example, to be replaced with an actual implementation
|
|
module MyModuleStatusConditions
|
|
class Active < MyModuleStatusCondition
|
|
def call(my_module)
|
|
my_module.errors.add(:status_conditions, I18n.t('my_module_statuses.conditions.error.my_module_not_active')) unless my_module.active?
|
|
end
|
|
|
|
def description
|
|
I18n.t('my_module_statuses.conditions.error.my_module_not_active')
|
|
end
|
|
end
|
|
end
|