def create_permalink
self.permalink = “#{self.name} #{self.brand.name}”.parameterize
end
…
Failure/Error: Factory.create(:product)
NoMethodError:undefined method `name’ for nil:NilClass
Why is that?
My guess would be that you’re not setting self.brand. I don’t see
anything in the Factory setting it.
-Dave
–
Dave A., President, Dave A. Software Engineering and Training
Ruby on Rails Freelancing (Northern Virginia, Washington DC, or Remote) DaveAronson.com, Codosaur.us, Dare2XL.com, & RecruitingRants.com (NEW!)
Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (me)