Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix regression re: #new with an STI object & complex inheritance #10038

Merged
merged 1 commit into from Apr 2, 2013

Conversation

Projects
None yet
4 participants
Contributor

nateberkopec commented Apr 1, 2013

Test case fails on the current master branch, but works on 3-2-stable.

Calling #subclasses here only catches the direct children, which causes creating a new complex subclass to fail.

@carlosantoniodasilva carlosantoniodasilva commented on an outdated diff Apr 2, 2013

activerecord/test/cases/inheritance_test.rb
@@ -194,6 +194,10 @@ def test_new_with_unrelated_type
assert_raise(ActiveRecord::SubclassNotFound) { Company.new(:type => 'Account') }
end
+ def test_new_with_complex_inheritance
+ assert_nothing_raised { Client.new(:type => 'VerySpecialClient') }
@carlosantoniodasilva

carlosantoniodasilva Apr 2, 2013

Owner

Too many spaces 😄

Contributor

nateberkopec commented Apr 2, 2013

Fixed the spaces issue! 😅

@senny senny and 1 other commented on an outdated diff Apr 2, 2013

activerecord/test/cases/inheritance_test.rb
@@ -194,6 +194,10 @@ def test_new_with_unrelated_type
assert_raise(ActiveRecord::SubclassNotFound) { Company.new(:type => 'Account') }
end
+ def test_new_with_complex_inheritance
+ assert_nothing_raised { Client.new(:type => 'VerySpecialClient') }
@senny

senny Apr 2, 2013

Member

could you update to Ruby 1.9 hash syntax? On the master branch we try to stick to the 1.9 Syntax when possible.

@nateberkopec

nateberkopec Apr 2, 2013

Contributor

Whoops! Fixed.

Member

senny commented Apr 2, 2013

looks good to me. I think we don't need a changelog entry as it is fixing a regression only present on master.

@carlosantoniodasilva @rafaelfranca can you take another look?

@rafaelfranca rafaelfranca added a commit that referenced this pull request Apr 2, 2013

@rafaelfranca rafaelfranca Merge pull request #10038 from nateberkopec/sti-new-with-complex-inhe…
…ritance

Fix regression re: #new with an STI object & complex inheritance
6fee836

@rafaelfranca rafaelfranca merged commit 6fee836 into rails:master Apr 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment