Unscope assoc calls from FakeServiceUser, we can delete this once the last default scope has been removed in the follow merge

This commit is contained in:
Raphael Sofaer 2011-05-17 10:24:28 -07:00
parent f9ef9a4b47
commit 0a8ce3b9f2
2 changed files with 2 additions and 1 deletions

View file

@ -45,7 +45,7 @@ class FakeServiceUser < HashWithIndifferentAccess
ServiceUser.reflect_on_all_associations.each do |assoc| ServiceUser.reflect_on_all_associations.each do |assoc|
define_method assoc.name do define_method assoc.name do
if associated_id = self[assoc.primary_key_name] if associated_id = self[assoc.primary_key_name]
assoc.klass.find(associated_id) assoc.klass.unscoped.find(associated_id)
else else
nil nil
end end

View file

@ -134,6 +134,7 @@ describe FakeServiceUser do
it 'has association methods' do it 'has association methods' do
person = mock person = mock
Person.stub!(:unscoped).and_return(Person)
Person.should_receive(:find).with(@data[5]).and_return person Person.should_receive(:find).with(@data[5]).and_return person
@fake.person.should == person @fake.person.should == person
end end