class method
self.add_limit!
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18 PrivateAvailable in: v2.2.3 v2.3.18
Signature
self.add_limit!(sql, options, scope = :auto)
The optional scope argument is for the current :find scope.
Parameters
-
sqlreq -
optionsreq -
scopeopt = :auto
Source
# File activerecord/lib/active_record/base.rb, line 1795
def add_limit!(sql, options, scope = :auto)
scope = scope(:find) if :auto == scope
if scope
options[:limit] ||= scope[:limit]
options[:offset] ||= scope[:offset]
end
connection.add_limit_offset!(sql, options)
end
Defined in activerecord/lib/active_record/base.rb line 1795
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Base