-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement for session binding #198
Enhancement for session binding #198
Conversation
(@rails-bot has picked a reviewer for you, use r? to override) |
@@ -64,6 +64,10 @@ def switch_binding_to(index) | |||
|
|||
private | |||
|
|||
def initial_binding | |||
@bindings.find {|b| b.eval('__FILE__').start_with?(Rails.root.to_s) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we expect that __FILE__
will always be a string? I think we can hit cases where it is nil
for bindings in {instance_,class_,}eval
string blocks, so we probably have to do b.eval('__FILE__').to_s
in here.
Also a small style nit: { |b|
vs {|b|
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree with that :-) I will fix them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
c7e31ce
to
d60583a
Compare
We should pass a binding or bindings to the Session.new()
d60583a
to
37be341
Compare
🎊 |
Thanks! 🙇 |
This pull request is to find a initial binding for each session. We use the first binding that is in
Rails.root
as the initial binding.Issue
From #194:
Details
Rails.root
Rails.root
to return suitable path on testingThank you.