aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-12-30 21:14:59 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-12-30 21:14:59 +0900
commit74ac546640487af45e62d599bc85cb30b725ea7f (patch)
tree6f8d7679f8467b829c24ac0e71ebc9e64590a37f /activerecord
parent18325d733360fc864eb800d95e56f404dfeeb7d6 (diff)
downloadrails-74ac546640487af45e62d599bc85cb30b725ea7f.tar.gz
rails-74ac546640487af45e62d599bc85cb30b725ea7f.tar.bz2
rails-74ac546640487af45e62d599bc85cb30b725ea7f.zip
Remove deprecated `#insert_sql`, `#update_sql`, and `#delete_sql`
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md4
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb6
-rw-r--r--activerecord/test/cases/database_statements_test.rb6
3 files changed, 4 insertions, 12 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 20406c3a9e..8c084248cb 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Remove deprecated `#insert_sql`, `#update_sql`, and `#delete_sql`.
+
+ *Ryuta Kamizono*
+
* Remove deprecated `#use_transactional_fixtures` configuration.
*Rafael Mendonça França*
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 7e7a3881f5..2c352819fb 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -126,22 +126,16 @@ module ActiveRecord
id_value || last_inserted_id(value)
end
alias create insert
- alias insert_sql insert
- deprecate insert_sql: :insert
# Executes the update statement and returns the number of rows affected.
def update(arel, name = nil, binds = [])
exec_update(to_sql(arel, binds), name, binds)
end
- alias update_sql update
- deprecate update_sql: :update
# Executes the delete statement and returns the number of rows affected.
def delete(arel, name = nil, binds = [])
exec_delete(to_sql(arel, binds), name, binds)
end
- alias delete_sql delete
- deprecate delete_sql: :delete
# Returns +true+ when the connection adapter supports prepared statement
# caching, otherwise returns +false+
diff --git a/activerecord/test/cases/database_statements_test.rb b/activerecord/test/cases/database_statements_test.rb
index bb16076fd2..66035865be 100644
--- a/activerecord/test/cases/database_statements_test.rb
+++ b/activerecord/test/cases/database_statements_test.rb
@@ -20,12 +20,6 @@ class DatabaseStatementsTest < ActiveRecord::TestCase
assert_not_nil return_the_inserted_id(method: :create)
end
- def test_insert_update_delete_sql_is_deprecated
- assert_deprecated { @connection.insert_sql("INSERT INTO accounts (firm_id,credit_limit) VALUES (42,5000)") }
- assert_deprecated { @connection.update_sql("UPDATE accounts SET credit_limit = 6000 WHERE firm_id = 42") }
- assert_deprecated { @connection.delete_sql("DELETE FROM accounts WHERE firm_id = 42") }
- end
-
private
def return_the_inserted_id(method:)