aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2013-07-20 04:55:37 -0700
committerBen Woosley <ben.woosley@gmail.com>2013-08-17 07:27:18 -0700
commitf87d8c7146d6601c57db1f9f4ec1d04fdd0a3f4a (patch)
treeb4df8028ebc9a4d4e029ef5c426020e55548d542 /activerecord
parent28189f2524d6d7754d6f39b18d24c4b47c258891 (diff)
downloadrails-f87d8c7146d6601c57db1f9f4ec1d04fdd0a3f4a.tar.gz
rails-f87d8c7146d6601c57db1f9f4ec1d04fdd0a3f4a.tar.bz2
rails-f87d8c7146d6601c57db1f9f4ec1d04fdd0a3f4a.zip
Stop interpreting SQL 'string' columns as :string type.
SQL doesn't have a string type, and interpreting 'string' as text is contrary to at least SQLite3's behavior: "Note that a declared type of 'STRING' has an affinity of NUMERIC, not TEXT." http://www.sqlite.org/datatype3.html
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/column.rb2
-rw-r--r--activerecord/test/cases/adapters/postgresql/quoting_test.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb
index bccfa41ad1..fb53090edc 100644
--- a/activerecord/lib/active_record/connection_adapters/column.rb
+++ b/activerecord/lib/active_record/connection_adapters/column.rb
@@ -272,7 +272,7 @@ module ActiveRecord
:text
when /blob/i, /binary/i
:binary
- when /char/i, /string/i
+ when /char/i
:string
when /boolean/i
:boolean
diff --git a/activerecord/test/cases/adapters/postgresql/quoting_test.rb b/activerecord/test/cases/adapters/postgresql/quoting_test.rb
index b3429648ee..a534f0e56a 100644
--- a/activerecord/test/cases/adapters/postgresql/quoting_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/quoting_test.rb
@@ -47,7 +47,7 @@ module ActiveRecord
def test_quote_cast_numeric
fixnum = 666
- c = Column.new(nil, nil, 'string')
+ c = Column.new(nil, nil, 'varchar')
assert_equal "'666'", @conn.quote(fixnum, c)
c = Column.new(nil, nil, 'text')
assert_equal "'666'", @conn.quote(fixnum, c)