Merge pull request #21994 from mtodd/inherit-scopes

Fix InheritanceTest#test_scope_inherited_properly implementation bugs
This commit is contained in:
Arthur Neves 2015-10-26 22:04:02 -04:00
commit 60c9701269
2 changed files with 3 additions and 3 deletions

@ -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)
}