mardi 3 mars 2015

Ignoring certain field when querying in Rails and ActiveRecord


Vote count:

0




I know that I can specify certain fields to query the database with pluck.



ids = Item.where('due_at < ?', 2.days.from_now).pluck(:id)


However I would like to know, whether there is a way to specify certain fields I would like to avoid querying from the db. Some kind of anti-pluck?



posts = Post.where(published: true).do_not_lookup(:enormous_field)


asked 35 secs ago

De G

965






Ignoring certain field when querying in Rails and ActiveRecord

Aucun commentaire:

Enregistrer un commentaire