Reputation: 126112
I'm working on an app that uses state_machine. I want to call a transition method but not persist the change, so that I have an opportunity to check whether the proposed change is authorized. Eg:
def some_controller_action
# ...
account.close # but don't save...
authorize account # will explode if current_user may not do this
if account.save ....
How can I do this?
Upvotes: 1
Views: 32
Reputation: 126112
false
Eg:
account.close(false) # does not save
This isn't exactly documented, but I found it here.
Upvotes: 1