Quantcast
Channel: wharsojo
Viewing all articles
Browse latest Browse all 10

Ruby – Rails – Tracing Call to Know Multiple Trigger-call

0
0

# 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



Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images