sqlite 好像可以按下面的方法写,但我用了 mongoid 这样写却不行。
has_many :comments, -> { order "posted_on" }
has_many :comments, -> { includes :author }
has_many :people, -> { where("deleted = 0").order("name") }, class_name: "Person"
has_many :tracks, -> { order "position" }, dependent: :destroy
has_many :reports, -> { readonly }