Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Define Proc object as an argument for `set_trace_func`
- set_trace_func lambda { |event, file, line, id, binding, klass|
- # Select `call` type events
- if event == 'call'
- # Your console would be filled with a lot of method call logs without any filter...
- if file.include?('active_record') || file.include?('active_model')
- puts "#{file}:#{line}"
- p klass, id
- puts ''
- end
- end
- }
- # And, you can call any method
- #
- # ex) Article.first.title
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement