0x2c7 / ruby_jard

Just Another Ruby Debugger. Provide a rich Terminal UI that visualizes everything your need, navigates your program with pleasure, stops at matter places only, reduces manual and mental efforts. You can now focus on real debugging.
https://rubyjard.org/
MIT License
844 stars 28 forks source link

[BUG] Debugging console freezes when executing a Rails' association on a model instance #77

Open bgvo opened 3 years ago

bgvo commented 3 years ago

It freezes when trying to run an Activerecord association. For instance:

User has_many :journeys

I'm inside User.some_method:

def some_method
  jard
  journeys
end

Inside the method, when I run:

jard >> journeys

It just freezes and won't output the ActiveRecord::Associations::CollectionProxy instance.

This doesn't happen with gem 'byebug', where I'm able to see the result.

Thanks!

krzykamil commented 3 years ago

Hey

I know this issue is somewhat old now, but I can't seem to replicate the issue.

def some_method
  jard
  orders
end

and then in console after calling the method:

jard >> orders
  Order Load (0.7ms)  SELECT "orders".* FROM "orders" WHERE "orders"."user_id" = $1  [["user_id", 27]]
=> []
jard >> 

Here my User model also has has_many relationship to orders.

Maybe the issue is/was connected to the way to call the method? I would be happy to help with the PR for the issue if we can replicate it.