Hi! I have the following Observer:
class NewsFeedObserver < ActiveRecord::Observer
observe :photo, :comment
def after_create(record)
end
end
What'd I'd like to learn how to do is add a SWITCH/IF statement in the after_create, so I know which model was created
Something like:
after_create(record)
switch model_type
case "photo"
do some stuff
case "comment"
do some other stuff
end
Or easier to visualize:
if record == 'Photo'
How can I take record, and determine the model name?