#RubyOnRails - 01 March 2019
« Back 1 day Forward 1 day »
[12:15:37] guyzmo: I need to debug a crash happening in a gem, I tried adding a `binding.pry` within the gem, but it's totally ignored, so I'd like to set a breakpoint at start up of the rails session within pry
[12:16:18] guyzmo: is there a way to launch the rails server and go straight in the debugger just at the right moment before leaving it go in its "main loop"?
[12:17:56] guyzmo: I guess I might need to add the binding.pry at some place in the init, and add some env variable to control whether I want it started or not, but then my question would be where would be the best place to put that?
[12:18:41] guyzmo: would the init time be the right place? like config/initializers/development.rb? or somewhere in my main app code? or…?
[15:47:55] guyzmo: I finally went with `binding.pry if ENV['START_PRY'].present?` within `development.rb` and it's working
[16:22:39] Sylario: I am using jsonapi-rb and I want to replace the field :content by :contentBody at deserialization, however the doc is lacking : http://jsonapi-rb.org/guides/deserialization/deserializing.html