rails 3.1.0 belongs_to ActiveResource no longer working
问题 I am upgrading from rails 3.0.7 to 3.1 and am having trouble getting my tests to pass. The problem occurs when I try to use a stubbed active resource object in a factory. #employee.rb class Employee < ActiveResource::Base; end #task.rb class Task < ActiveRecord::Base belongs_to :employee end #factories.rb Factory.define :employee do |e| e.name "name" end Factory.define :task do |t| t.employee { Factory.stub(:employee) } end On the console and in the spec stubbing an employee works.