I'm trying to make my fat model Userless awkward. I use value objects to represent custom values โโand operations on them, and I'm stuck with ActiveSupport::Concernand modules. I read this as an inspiration.
I put helper methods as follows:
def is_a_wizard?
power_level >= WIZARD_POWER
end
def just_became_a_wizard?
power_level == WIZARD_POWER
end
into modules and included them as a kind of extension. However, it is difficult to read and maintain, and I need some of them both in the views and in the controllers (for example, to authenticate the wizard). Where should I put them? Create service objects when they are used?
source
share