Skip to content

Commit

Permalink
Port test from cf1904f to avoid future regression
Browse files Browse the repository at this point in the history
Related issue: rails#11939, rails#12084
  • Loading branch information
sikachu committed Oct 3, 2013
1 parent faaa57f commit 0a26530
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion activerecord/test/cases/inheritance_test.rb
Expand Up @@ -313,8 +313,12 @@ def test_inheritance_without_mapping
assert_kind_of SpecialSubscriber, SpecialSubscriber.find("webster132")
assert_nothing_raised { s = SpecialSubscriber.new("name" => "And breaaaaathe!"); s.id = 'roger'; s.save }
end
end

def test_scope_inherited_properly
assert_nothing_raised { Company.of_first_firm }
assert_nothing_raised { Client.of_first_firm }
end
end

class InheritanceComputeTypeTest < ActiveRecord::TestCase
fixtures :companies
Expand Down
5 changes: 5 additions & 0 deletions activerecord/test/models/company.rb
Expand Up @@ -11,6 +11,11 @@ class Company < AbstractCompany
has_many :contracts
has_many :developers, :through => :contracts

scope :of_first_firm, lambda {
joins(:account => :firm).
where('firms.id' => 1)
}

def arbitrary_method
"I am Jack's profound disappointment"
end
Expand Down

0 comments on commit 0a26530

Please sign in to comment.