Merge pull request #21994 from mtodd/inherit-scopes
Fix InheritanceTest#test_scope_inherited_properly implementation bugs
This commit is contained in:
commit
60c9701269
@ -352,8 +352,8 @@ def test_inheritance_without_mapping
|
||||
end
|
||||
|
||||
def test_scope_inherited_properly
|
||||
assert_nothing_raised { Company.of_first_firm }
|
||||
assert_nothing_raised { Client.of_first_firm }
|
||||
assert_nothing_raised { Company.of_first_firm.to_sql }
|
||||
assert_nothing_raised { Client.of_first_firm.to_sql }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -12,7 +12,7 @@ class Company < AbstractCompany
|
||||
has_many :developers, :through => :contracts
|
||||
|
||||
scope :of_first_firm, lambda {
|
||||
joins(:account => :firm).
|
||||
joins(:accounts => :firm).
|
||||
where('firms.id' => 1)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user