> Code has been updated with some fixes and demonstrates the problem
> better:http://pastie.org/1431647
It's a little difficult to tell, but from your stacktrace it looks
like you're calling #name on a nil object. Presumably this is
happening inside your ArtworkAttribute#get_attribute_name method,
where the code assumes self.attributename is always going to return an
object that is safe to call #name on.
What I would suggest doing is checking the database to see if the
associated record exists in all cases. If it's optional, you should
probably specify :required => false in the belongs_to declaration for
the association, and change your #get_attribute_name method to
something like:
def get_attribute_name
attributename.name if attributename
end
--
Dan Kubb
(dkubb)
--
You received this message because you are subscribed to the Google Groups
"DataMapper" 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/datamapper?hl=en.