forked from brynary/arel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
165a312
commit 19c5a95
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19c5a95
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.
Hey aaron, this commit seems to break a bunch of usecases where we need to load a (activerecord) model class before the database connection is available.
I wonder what the reasoning behind the refactoring is. Do you think we can have this reverted by any chance?
Thanks for all your great work, man :)
19c5a95
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.
Hey Sven! This refactor is to avoid the "||" test on every call to table_exists?. I thought it would be safe because the constructor seems to assume an active connection. I am probably mistaken though. ;-)
I'm happy to revert this, but would you mind giving me a test case to show the problem? I'm afraid if I don't have a test case, I'll end up making this change again. Thanks!
19c5a95
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.
Ah great :) Sure, I'll provide a test
19c5a95
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.
Hi Aaron, I've pushed two fixes here: http://github.com/svenfuchs/arel/commits/master
I'm not sure the tests in http://github.com/svenfuchs/arel/commit/4b476404cbbecfedc255039c66c6eececb667d7f#L1R122 will work fine for all adapters. Unfortunately I was only able to run this on Sqlite3 right now.
19c5a95
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.
Hey, Aaron, I've seen you've tagged an rc ... could you pull this before the final release?
19c5a95
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.
@sven done, but you owe me a test. ;-)
19c5a95
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.
Hey, thanks :)
But there's tests here: http://github.com/svenfuchs/arel/commit/4b476404cbbecfedc255039c66c6eececb667d7f#L1R120
Or do you mean they aren't passing on any other db engine?
Also, have you seen this one? http://github.com/svenfuchs/arel/commit/3b1b24551106bc116cba404c992b513c5fbd137b
It's a real bug w/ Rails 3.0.0.rc2 imho, because one can't use Table#as at all if the Table has been initialized with an engine as a second argument (which seems to happen in ActiveRecord all the time?)