method
sanitize_limit
v3.0.0 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::DatabaseStatements
sanitize_limit(limit)protected
Sanitizes the given LIMIT parameter in order to prevent SQL injection.
limit may be anything that can evaluate to a string via #to_s. It should look like an integer, or a comma-delimited list of integers.
Returns the sanitized limit parameter, either as an integer, or as a string which contains a comma-delimited list of integers.