Your solution works much better though, thanks.




On Jan 19, 2011, at 12:49 PM, RipTheJacker wrote:

> I believe that anonymous classes work differently in 1.9.2, so come
> class variables DM might need may not be available when you are
> creating classes in that fashion. However, you can simplify that
> method so that it works in both:
> 
> def create_class(class_name, &block)
>  Object.full_const_set class_name, DataMapper::Model.new(&block)
> end
> 
> That way, you also can get rid of the: 'include DataMapper::Resource'
> 
> so: http://pastie.org/1478183
> 
> 
> 
> On Jan 19, 12:16 am, Joshua Griffith <[email protected]> wrote:
>> Hello,
>> 
>> When dynamically creating resource classes, I'm getting the following
>> error:
>> ruby-1.9.2-p136/gems/dm-core-1.0.2/lib/dm-core/associations/
>> relationship.rb:494:in `initialize_object_ivar': parent_model does not
>> respond to #to_str or #name (ArgumentError)
>> 
>> This error does not get thrown when using ruby 1.8.7. Can anyone
>> assist me in tracking down the problem? Here is the test 
>> case:http://pastie.org/1476312
>> 
>> Thanks,
>> 
>> Joshua
> 
> -- 
> 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.
> 

-- 
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.

Reply via email to