skinny-framework / skinny-framework

:monorail: "Scala on Rails" - A full-stack web app framework for rapid development in Scala

Home Page:https://skinny-framework.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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.

  1. developer must concern query is empty or not.
  2. there seems to be no spec for this.(sorry if there is.)
  3. different from scalikejdbc's in clause.
  4. 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.