How to use Arel in Rails in order to sort by a PostgreSQL hstore valueFor the past 2 days I was struggling with sorting an ActiveRecord relation by a value in a hstore hash. I currently work on a project that is a product catalog. Every attribute of the Product model had to be translated into multiple languages. So I picked the hstore_translations gem. In a nutshell the gem stores translations of
We recently came across an interesting problem, which was discussed in a previous post, Postgres Window Functions: We want to get each post’s three most recent comments. As discussed, you can’t use simple eager loading: Post.order(created_at: :desc).limit(5).includes(:comments) This will load every comment for each post. When there are many comments per post, this quickly becomes unacceptable. Sta
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く