diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-25 13:48:35 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-25 13:48:35 -0700 |
commit | 6b436c23a90cb3bb2e2d55902a55fc6f659b90be (patch) | |
tree | 0a9c74c9c7b7be0a1c216e7e0ecc121d6da42f06 /activerecord/lib/active_record/connection_adapters/abstract | |
parent | d25b7c2eeefff3a0abf7b532c10ce25a71d0fba2 (diff) | |
parent | 542114e1d82fffa1062ef0eaa1053959ab9d14ec (diff) | |
download | rails-6b436c23a90cb3bb2e2d55902a55fc6f659b90be.tar.gz rails-6b436c23a90cb3bb2e2d55902a55fc6f659b90be.tar.bz2 rails-6b436c23a90cb3bb2e2d55902a55fc6f659b90be.zip |
Merge pull request #1285 from joshk/remove_active_record_deprecations
removed deprecated methods, and related tests, from ActiveRecord
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb index b3eb23bbb3..ab85171e11 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb @@ -1,5 +1,3 @@ -require 'active_support/core_ext/module/deprecation' - module ActiveRecord module ConnectionAdapters # :nodoc: module DatabaseStatements @@ -245,31 +243,6 @@ module ActiveRecord # done if the transaction block raises an exception or returns false. def rollback_db_transaction() end - # Appends +LIMIT+ and +OFFSET+ options to an SQL statement, or some SQL - # fragment that has the same semantics as LIMIT and OFFSET. - # - # +options+ must be a Hash which contains a +:limit+ option - # and an +:offset+ option. - # - # This method *modifies* the +sql+ parameter. - # - # This method is deprecated!! Stop using it! - # - # ===== Examples - # add_limit_offset!('SELECT * FROM suppliers', {:limit => 10, :offset => 50}) - # generates - # SELECT * FROM suppliers LIMIT 10 OFFSET 50 - def add_limit_offset!(sql, options) - if limit = options[:limit] - sql << " LIMIT #{sanitize_limit(limit)}" - end - if offset = options[:offset] - sql << " OFFSET #{offset.to_i}" - end - sql - end - deprecate :add_limit_offset! - def default_sequence_name(table, column) nil end @@ -308,10 +281,10 @@ module ActiveRecord # Sanitizes the given LIMIT parameter in order to prevent SQL injection. # # The +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, or + # should look like an integer, or a comma-delimited list of integers, or # an Arel SQL literal. # - # Returns Integer and Arel::Nodes::SqlLiteral limits as is. + # Returns Integer and Arel::Nodes::SqlLiteral limits as is. # Returns the sanitized limit parameter, either as an integer, or as a # string which contains a comma-delimited list of integers. def sanitize_limit(limit) |