diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-19 13:57:14 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-19 13:57:14 -0800 |
commit | ccaa3e47c4fd1e35bbd986faf1b4994fce3d68d0 (patch) | |
tree | 1b5e992df52608c53c2d4536562e497fbe236e8c /activerecord/test | |
parent | ecde74e1b00d72113775b17ad953cc95ecac3627 (diff) | |
parent | 4a720a2cdefc1926e0bfa23b8febd71869093c59 (diff) | |
download | rails-ccaa3e47c4fd1e35bbd986faf1b4994fce3d68d0.tar.gz rails-ccaa3e47c4fd1e35bbd986faf1b4994fce3d68d0.tar.bz2 rails-ccaa3e47c4fd1e35bbd986faf1b4994fce3d68d0.zip |
Merge pull request #13412 from arthurnn/quote_id_not_id
quoting: Check if id is a valid method before using it
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/quoting_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb index a7b2764fc1..ba89487838 100644 --- a/activerecord/test/cases/adapters/sqlite3/quoting_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/quoting_test.rb @@ -95,6 +95,13 @@ module ActiveRecord end }.new assert_equal 10, @conn.type_cast(quoted_id_obj, nil) + + quoted_id_obj = Class.new { + def quoted_id + "'zomg'" + end + } + assert_raise(TypeError) { @conn.type_cast(quoted_id_obj, nil) } end end end |