For example, we have something like this. We want to activate user after submit
class UserForm < Tramway::BaseForm
def submit(params)
super.tap do |result|
object.activate if result == true
end
end
end
Maybe we should implement callbacks in Tramway Form to be able do something like this?
class UserForm < Tramway::BaseForm
after_submit -> { object.activate }
after_resist -> { object.deactivate }
end
I think it will allow to us do something this too
class Users::RejectForm < Tramway::BaseForm
properties :reject_reason
after_submit -> { user.reject }
end
What do you think?
Originally posted by @kalashnikovisme in #47