1.~~~ids = Object.where(条件).pluck(:id)
2.Hoge = Object.find(~~~ids)
Hogeにwhereの条件で絞った、オブジェクトが複数得れる
We'll deliver articles that match you.
You can read useful information later.
Go to list of users who liked
More than 1 year has passed since last update.
1.~~~ids = Object.where(条件).pluck(:id)
2.Hoge = Object.find(~~~ids)
Hogeにwhereの条件で絞った、オブジェクトが複数得れる
Register as a new user and use Qiita more conveniently
Go to list of users who liked