0x2c7/ruby_jard

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

bgvo opened this issue · 1 comments

bgvo commented

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!

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.