Hello, I'm creating a observer model: booklogger_observer.rb
The observer model looks a little something like this:
class BookLoggerObserver < ActiveRecord::Observer
observe :book
def after_create(record)
@logitem = ......app specific stuff
@logitem = ......
@logitem = ......
assign_meta(@logitem)
@logitem.save!
end
def after_save(record)
@logitem = ......
@logitem = ......
@logitem = ......
assign_meta(@logitem)
@logitem.save!
end
def assign_meta(@logitem)
@logitem = ......
@logitem = ......
@logitem = ......
end
end
Where I'm stuck is I want to use DEF assign_meta to perform actions that are common across after_create and after_save, but I'm not familar with passing the @logitem to the DEF and then sending it back to be saved.
Can you help me understand this flow?
Thank you