Tôi làm cách nào để sắp xếp các kết quả truy vấn bằng thuộc tính hstore?Làm cách nào để sắp xếp các kết quả theo thuộc tính hstore trong Rails 4?
@items = Item.includes(:product).order('products.properties @> hstore("platform")')
Nguyên nhân
PG::Error: ERROR: column "platform" does not exist
LINE 1: ...oduct_id" ORDER BY products.properties @> hstore("platform"...
platform
là chìa khóa hstore, được lưu trữ trong cột tài sản, đó là một loại hstore.