-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
class Comment
include Mongoid::Document
field :content
referenced_in :post
end
class Post
include Mongoid::Document
field :title
references_many :comments, :default_order => :_id.desc
end
<pre>
post = Post.create :title => 'new post'
post.comments.create :content => 'c1'
post.comments.create :content => 'c2'
</pre>
For 2.0.0.beta.19 the following code work as expected:
> post.comments.map(&:content) => ["c2", "c1"]
But for 2.0.0.rc.6 the :default_order is ignored:
> post.comments.map(&:content) => ["c1", "c2"]