aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-02-01 19:59:17 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-02-24 06:56:06 +0900
commitd15527800fbc199b969019c665226f836d8fedce (patch)
treeb654c648b30a1e70e463fc7b5652183ab9a094cf /activerecord/test
parenta5586126d179ad89bf48dd09fb4c8d98be3a841c (diff)
downloadrails-d15527800fbc199b969019c665226f836d8fedce.tar.gz
rails-d15527800fbc199b969019c665226f836d8fedce.tar.bz2
rails-d15527800fbc199b969019c665226f836d8fedce.zip
Deprecate using `#quoted_id` in quoting
Originally `quoted_id` was used in legacy quoting mechanism. Now we use type casting mechanism for that. Let's deprecate `quoted_id`.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/quoting_test.rb2
-rw-r--r--activerecord/test/cases/sanitize_test.rb10
2 files changed, 8 insertions, 4 deletions
diff --git a/activerecord/test/cases/quoting_test.rb b/activerecord/test/cases/quoting_test.rb
index 2541adbe72..f260d043e4 100644
--- a/activerecord/test/cases/quoting_test.rb
+++ b/activerecord/test/cases/quoting_test.rb
@@ -82,7 +82,7 @@ module ActiveRecord
end
def test_quote_with_quoted_id
- assert_equal 1, @quoter.quote(Struct.new(:quoted_id).new(1))
+ assert_deprecated { assert_equal 1, @quoter.quote(Struct.new(:quoted_id).new(1)) }
end
def test_quote_nil
diff --git a/activerecord/test/cases/sanitize_test.rb b/activerecord/test/cases/sanitize_test.rb
index 23bcb0af1e..72f09186e2 100644
--- a/activerecord/test/cases/sanitize_test.rb
+++ b/activerecord/test/cases/sanitize_test.rb
@@ -152,11 +152,15 @@ class SanitizeTest < ActiveRecord::TestCase
end
def test_bind_record
- o = Struct.new(:quoted_id).new(1)
- assert_equal "1", bind("?", o)
+ o = Class.new {
+ def quoted_id
+ 1
+ end
+ }.new
+ assert_deprecated { assert_equal "1", bind("?", o) }
os = [o] * 3
- assert_equal "1,1,1", bind("?", os)
+ assert_deprecated { assert_equal "1,1,1", bind("?", os) }
end
def test_named_bind_with_postgresql_type_casts