Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最初のIDを除くすべてのIDを選択したい。 User.find(:all)はすべてのIDを呼び出しますが、どうすれば例外を作成できますか?
単一のクエリを介して:
User.offset(1).pluck(:id)
最初のものを除くすべてのIDを提供します
User.where(:_id.ne => User.first.id).map(&:_id)