Caching ActiveRecord queries (not query results!) for performance gain

前端 未结 0 1587
无人共我
无人共我 2020-12-10 00:13

Say I have a function like this:

def do_query(id, name)
  users = User.where(id: id, name: name)

  users.each do |user|
    # ...
  end
end

相关标签:
回答
  • 消灭零回复
提交回复
热议问题