class MyModule::MyModel
include Mongoid::Document
field :field1, :type=>Integer
...
field :fieldn, :type=>Integer
field :deleted, :type=>Boolean
store_in session: 'mydb
我有Postactivity模型,其中post_id作爲Post Model的外鍵(has_one關係),並且此Postactivity模型具有likes數組。 我該如何排序Post model by likes? class Post
has_one :postactivity, foreign_key: :post_activity_id, class_name:"PostActiv
考慮下面的模型 class MyModel # `Employee` used in concrete examples
field :field1 # company_name used in concrete examples
field :field2 # job_name used in concrete examples
scope: filter1 # n