title: Rails4: Using Rails Concerns in calling callbacks
body: <p>Using rails4, I am trying to implement notification model. Here I use ActiveSupport::Concern to separate my notification related code from the model.
      create_notification_module.rb</p>
  
  <pre><code>module CreateNotificationModule
     extend ActiveSupport::Concern
     include ActiveModel::Dirty
  
     included do
       after_update :notify 
       after_create :notify
       after_create :notify
     end
     def notify
       record = Notification.new( 
                    :ref_table =&gt; self.class,                           
                    :ref_id =&gt; self.id,                          
                    :receiver =&gt; ? ,  # owner of the parent model if parent exists
                    :sender =&gt; current_user.id,     
                    :details =&gt; self.changes,                   
                    :is_read =&gt; 0)
       record.save!
  
     end
  </code></pre>
  
  <p>Here I need to know from which controller/model this callback is called, so that I can write my switch case. For ex., 
  case comment: to get the owner of the message to which user comments
  case like: to get the owner of msg/cmt which is liked etc.,  any help is appreciated.</p>