jgaskins / perpetuity-postgres

Postgres adapter for Perpetuity
MIT License
10 stars 7 forks source link

Enumerable predicates on query attributes #5

Closed jgaskins closed 10 years ago

jgaskins commented 10 years ago

In jgaskins/perpetuity#32, it was proposed that we add predicate methods to query attributes to match the ones in Ruby's Enumerable module for queries like this:

Perpetuity[User].select { |user| user.friends.any? }

Using Postgres' json_array_length function, this is totally doable:

jgaskins commented 10 years ago

Fixed in 17867453cbbd8e27c932bb4ac35e38af9cca37fa