Hi,
We are using AASM in quite a few of our models, but we're looking at simplifying a bit the models. One of the things we'd like to do is to move all the Notification stuff out of the models and into Observers.
So considering:
class ClarificationRequest < ActiveRecord::Base
include AASM
aasm_initial_state :open
# States
aasm_state :open
aasm_state :closed
# Events
aasm_event :close, :after => :notify_closed do transitions :to => :closed, :from => [:open,:replied], :guard => :can_close? end
end
I've tried this, but with no luck:
class ClarificationRequestObserver < ActiveRecord::Observer
observe :clarification_request
def after_close
puts '############### message from observer!!!!!'
end
end
How can I move the :notify_closed to an Observer?
Thx!
.Karim