mongoid/mongoid — Issue #1744: Ordering by embedded doc's localized field doesn't work
Author: semaperepelitsa
Created: 2012-02-22 11:17:25+00:00
State: open

```ruby
class Article
include Mongoid::Document
embeds_many :comments
field :title, localize: true
end

class Comment
include Mongoid::Document
embedded_in :article
field :title, localize: true
end
```

```ruby
@article = Article.new
@a = @article.comments.build(title: "A")
@c = @article.comments.build(title: "C")
@b = @article.comments.build(title: "B")
@article.save!
assert_equal @article.comments.asc(:title).to_a, [@a, @b, @c] #fails
assert_equal @article.comments.desc(:title).to_a, [@c, @b, @a]
```

Full example app with the test case: https://github.com/semaperepelitsa/mongoid_rails_app/tree/embedded_sort_localized