On Thu, Dec 29, 2011 at 05:28, Linus Pettersson
<[email protected]> wrote:

> 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 Aronson, President, Dave Aronson 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)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to