【发布时间】:2015-03-03 13:13:59
【问题描述】:
我知道我可以指定某些字段来使用pluck查询数据库。
ids = Item.where('due_at < ?', 2.days.from_now).pluck(:id)
但是我想知道,是否有办法指定我想避免从数据库中查询的某些字段。某种反采摘?
posts = Post.where(published: true).do_not_lookup(:enormous_field)
【问题讨论】:
-
Item.where('due_at
标签: ruby-on-rails ruby ruby-on-rails-4 activerecord