Guard against @subqueries being empty #4

Open
wants to merge 2 commits into
from

Projects

None yet

1 participant

@pivotalneutron

For queries without subqueries (ie: UPDATE), calling SqlQuery#table raises a
NoMethodError, since @subqueries is an empty array and [].first returns nil.
This happens if such a query triggers a warning (see SqlQuery#warn).

(We wanted to include a unit test, but they don't seem to be in working order.)

Arzumy MD & ... added some commits May 5, 2011
Arzumy MD & Mike Mazur Add .rvmrc to .gitignore f9b8baa
Arzumy MD & Mike Mazur Guard against @subqueries being empty
For queries without subqueries (ie: UPDATE), calling SqlQuery#table raises a
NoMethodError, since @subqueries is an empty array and [].first returns nil.
This happens if such a query triggers a warning (see SqlQuery#warn).
a833ea6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment