globalize/globalize — pull request #388 by firedev (2014-11-29 02:46:27+00:00)
Title: Added uniq to prevent duplications of records

I am glad this part got some attention before I was patching globalize like this:

```ruby
module Globalize::ActiveRecord::ClassMethods
def with_translations(*locales)
if locales.empty?
includes(:translations).references(:translations) # my code
else
preload(:translations) # original code
.joins(:translations)
.readonly(false)
.with_locales(locales)
.with_required_attributes
end
end
end
```

However the new way causes duplicated records to appear when using `model.with_translations`, I propose to add `uniq` at least. In fact it was perfect like I had it with `includes(:translations).references(:translations)` but I see new version adds a bit more to the preload.