-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Refactor class_eval with string into class_eval with block #215
Conversation
Travis build fails because:
I can fix the first by requiring (Nevermind the second point, just noticed the use of EDIT: I've proposed a fix to the Travis build in #216 |
Thanks for this @rdvdijk. Let's take a look at this once we've sorted out the rack problem :) |
Hi @rdvdijk, can you rebase this to master (I've fixed the tests), and see how the suite runs? |
f265298
to
11020f4
Compare
@brendon Rebased. I left the tab-to-spaces fix in the Gemfile 😉 Thanks for improving upon my appraisals/rack PR. |
Thanks @rdvdijk :) All seems to have passed. @swanandp, @fabn, and @krzysiek1507 did you want to have any input into this one? |
def scope_condition | ||
{ #{configuration[:scope]}: send(:#{configuration[:scope]}) } | ||
end | ||
class_calling_acts_as_list = self |
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.
Somehow this name doesn't sound good. Maybe caller_class
?
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.
Agreed :)
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.
Maybe caller_class ?
Sounds good. I'll change it.
Good stuff! Just left a minor comment. |
Ok, once that's fixed, I'll merge this one. |
Oh, also needs rebasing :) |
Ah, feedback! I've been away on holiday, I'll take a look at the comments soon. And do another rebase. 😄 |
11020f4
to
57923ee
Compare
@brendon I've fixed the variable name and rebased. The |
Thanks @rdvdijk, I think the reason why there were no explicit tests was that it was just a refactor of existing code, though for sure, they could have attempted to test for their obscure failure case. I might ping them on that. I'm happy to merge this now. Thank you for all your hard work on this. |
Awesome, thanks! About my initial comment about the remaining string- |
Let's open this up in a new issue. :) |
This commit changes the "
class_eval
with string"-style to "class_eval
with block"-style.The only worry I have is the remaining string
eval
in the method definition on line 96:Of course this eval happens in the current code, but just isn't that obvious as it is now.
Added bonus is that the position column is now quoted lazily, removing the need of an established database connection at model load-time, as mentioned in #214.
(Now let's see if all supported Ruby versions agree with this, Travis will let us know soon 😉)