aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-05-18 15:57:28 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-05-18 15:57:28 -0300
commitfc628f7ad8fed642167297e0d50a1cad7e3da831 (patch)
tree6d1daad9ae6b18f4e1d769f319e06dd78b730c09 /activerecord/test
parent0cae22d2ec42512bc496a2a344adc912ab9110d7 (diff)
parent684caf55038234374a17c1e010e8b18d2dc0c90f (diff)
downloadrails-fc628f7ad8fed642167297e0d50a1cad7e3da831.tar.gz
rails-fc628f7ad8fed642167297e0d50a1cad7e3da831.tar.bz2
rails-fc628f7ad8fed642167297e0d50a1cad7e3da831.zip
Merge pull request #20190 from kamipo/fix_serial_with_quoted_sequence_name
Fix `serial?` with quoted sequence name
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/primary_keys_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb
index 83be9a75d8..b8433f0bba 100644
--- a/activerecord/test/cases/primary_keys_test.rb
+++ b/activerecord/test/cases/primary_keys_test.rb
@@ -175,6 +175,14 @@ class PrimaryKeysTest < ActiveRecord::TestCase
dashboard = Dashboard.first
assert_equal '2', dashboard.id
end
+
+ if current_adapter?(:PostgreSQLAdapter)
+ def test_serial_with_quoted_sequence_name
+ column = MixedCaseMonkey.columns_hash[MixedCaseMonkey.primary_key]
+ assert_equal "nextval('\"mixed_case_monkeys_monkeyID_seq\"'::regclass)", column.default_function
+ assert column.serial?
+ end
+ end
end
class PrimaryKeyWithNoConnectionTest < ActiveRecord::TestCase