[orm] where('col_name -> Nil) condition is removed
yamitzky opened this issue · comments
This is behavioral (feature?) request.
In Skinny-ORM, when a condition is specifying Nil
to where
's second term, the condition is removed(ignored).
For example,
Company.where('id -> Nil).apply()
is same as
Company.apply()
which means, it fetches all table instead of empty result.
I think this behavior is not natural for these reasons.
- developer must concern query is empty or not.
- there seems to be no spec for this.(sorry if there is.)
- different from scalikejdbc's
in
clause. - different from ActiveRecord's
where
.
In addition to that, it was introduced after the commit 56495db (Fixed invalid eager loading for PostgreSQL when ids is empty).
Can you change this behavior?
Thanks. This should be fixed.
Thank you for your report. Next version will be out within a few days. If you're in a hurry, please let me know.