diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-20 08:00:52 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-20 14:13:45 -0200 |
commit | 50f00463bd8348c35cc5dad40116e21323f6822f (patch) | |
tree | c749e764ce2832b095a448e800bb4fd27576d293 /activerecord/test/cases | |
parent | bd87bd95646c2b94c602dff7d0a1f7e75c303e51 (diff) | |
download | rails-50f00463bd8348c35cc5dad40116e21323f6822f.tar.gz rails-50f00463bd8348c35cc5dad40116e21323f6822f.tar.bz2 rails-50f00463bd8348c35cc5dad40116e21323f6822f.zip |
Merge pull request #8276 from pwnall/pgsql_text_limits
Postgresql doesn't accepts limits on text columns
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/sql_types_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/sql_types_test.rb b/activerecord/test/cases/adapters/postgresql/sql_types_test.rb new file mode 100644 index 0000000000..d7d40f6385 --- /dev/null +++ b/activerecord/test/cases/adapters/postgresql/sql_types_test.rb @@ -0,0 +1,18 @@ +require "cases/helper" + +class SqlTypesTest < ActiveRecord::TestCase + def test_binary_types + assert_equal 'bytea', type_to_sql(:binary, 100_000) + assert_raise ActiveRecord::ActiveRecordError do + type_to_sql :binary, 4294967295 + end + assert_equal 'text', type_to_sql(:text, 100_000) + assert_raise ActiveRecord::ActiveRecordError do + type_to_sql :text, 4294967295 + end + end + + def type_to_sql(*args) + ActiveRecord::Base.connection.type_to_sql(*args) + end +end |