Wednesday, 15 June 2011

mongoid sortable list grouped by association -



mongoid sortable list grouped by association -

i have 2 models review , product. product has many reviews.

is there gem can sort reviews belonging product? far using mongoid-orderable sort reviews. doesn't have ability sort reviews of product.

thank you!

is review embedded document?

you can sort reviews during query using #sort based on field order of collection review or other field, created_at example.

my_product.reviews.order_by(:created_at)

mongoid sortable

No comments:

Post a Comment