Rails 6.1で `created_at > ?` みたいなクエリをいい感じに生成する - かみぽわーる
Rails 6.1の目玉機能として以下のように書けるwhere拡張を入れてたんですが、いろいろあって6.1からはrevertされてしまいました🥲 posts = Post.order(:id) posts.where("id >": 9).pluck(:id) # => [10, 11] posts.where("id >=": 9).pluck(:id) # => [9, 10, 11] posts.where("id <": 3).pluck(:id) # => [1, 2] posts....
みんなの反応
はてなブックマークでの反応
※メールアドレスは公開されません。