I am looking to have my after_update hook only fire if the status_was value for my object was one of two values:
after_update :set_activity_log, :if => :status_was == 'In' or :status_was == 'Out'
I can get this to work with #status_changed? But then it still fires on all other possible status changes and I’m forced to add the logic to check on the In or Out in the callback method anyways.
I feel like this should be achievable in the hook definition instead of in the set_activity_log method.
Per the documentation you can pass a Proc to an ActiveRecord callback: