rails/activerecord/test/models/liquid.rb
Yves Senn a1bb6c8b06 rename Relation#uniq to Relation#distinct. #uniq still works.
The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our
Relation API is close to SQL terms I renamed `#uniq` to `#distinct`.

There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue
to work. I also updated the documentation to promote the use of `#distinct`.
2013-03-15 14:15:47 +01:00

5 lines
105 B
Ruby

class Liquid < ActiveRecord::Base
self.table_name = :liquid
has_many :molecules, -> { distinct }
end