如何按 hstore 属性对查询结果进行排序?
@items = Item.includes(:product).order('products.properties @> hstore("platform")')
原因
PG::Error: ERROR: column "platform" does not exist
LINE 1: ...oduct_id" ORDER BY products.properties @> hstore("platform"...
platform
是一个hstore key,存放在properties列中,是一个hstore类型。