diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-04 15:19:17 -0800 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-04 15:19:17 -0800 |
commit | 4ded0dd2de4dca40fcb7ccbc215db4c098a6629d (patch) | |
tree | c108a72e7ae9e85a35a73981b71c25b1490b3f03 /activerecord/test/cases | |
parent | 4e74bd194beb6f51ee7c4bf06bfaab72d70f1c2c (diff) | |
parent | 82ae5c40ea29eecc2c0d017ffc7c2f2a23a7e21f (diff) | |
download | rails-4ded0dd2de4dca40fcb7ccbc215db4c098a6629d.tar.gz rails-4ded0dd2de4dca40fcb7ccbc215db4c098a6629d.tar.bz2 rails-4ded0dd2de4dca40fcb7ccbc215db4c098a6629d.zip |
Merge pull request #3851 from ebeigarts/fix_sequence_name
Fix sequence name with abstract classes.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index d846eb03aa..343c8ef373 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1601,6 +1601,16 @@ class BasicsTest < ActiveRecord::TestCase end end + def test_sequence_name_with_abstract_class + ak = Class.new(ActiveRecord::Base) + ak.abstract_class = true + k = Class.new(ak) + k.table_name = "projects" + orig_name = k.sequence_name + return skip "sequences not supported by db" unless orig_name + assert_equal k.reset_sequence_name, orig_name + end + def test_count_with_join res = Post.count_by_sql "SELECT COUNT(*) FROM posts LEFT JOIN comments ON posts.id=comments.post_id WHERE posts.#{QUOTED_TYPE} = 'Post'" |