I am using Ruby on Rails 3, and I would like to limit the search to the method wherefrom ActiveRecord::QueryMethods, using something as the following
Users.where(:name => "Test_name", :limit => 10)
Users.where(:name => "Test_name").limit(10)
That is, I would like to request only 10 records. How can i do this?
The RoR source code has:
def where(opts, *rest)
relation = clone
relation.where_values += build_where(opts, rest) unless opts.blank?
relation
end
source
share