Bobochka
11/19/2015 - 6:32 PM

Print caller for query

Print caller for query

ActiveSupport::Notifications.subscribe("sql.active_record") do |_, _, _, _, details|
  if details[:sql] =~ /INSERT INTO "spree_inventory_units"/
    puts caller.join("\n")
    puts "*" * 50
  end
end