Skip navigation

# Ruby - Rails - Tracing Call to Know Multiple Trigger-call
class Model

  before_update :show_changed_fields

  def show_changed_fields
    p '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
    p Model.columns.map(&:name).select{|v|self.send("#{v}_changed?".to_sym) }
    p caller.select{|x|/\/app\//=~x}.collect{|x|x.split('/')[-1]}
  end

end

Advertisements

One Comment

  1. Sort by SongnFirst Song: (This Is) The Dream of Evan and Chan – Ben GibbardnLast Song: u9f99u5973u4e4bu58f0 – Some chinese instrumental, I have no idea by who Click http://link.mx/hool08200


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: