In my rails application, I want to get the last 10 entries with a unique value.
I tried:
@users = User.all(:limit => 10, :sort => [:created_at, :desc]).map{|t| t.first_name}.uniq
but
the limit does not work as I expect.
I want "limit" to execute the last request.
any ideas?
source share