I copied the module code modified my Part class to look like that.
Then I updated TextPart, TablePart, etc to include Part, instead of
DataMapper::Resource. However running rake db:automigrate results in
the following error: rake aborted! undefined method `properties' for
Part:Module

As I understand it, dm-is-remixable does more or less what your code
would do. I was was really wanting a parts table to hold the common
properties, plus that would give me a single, unified part_id to
reference.

Another technique I thought of was to have two properties on the Part
model, one for the part-type's name (like Discriminator does) and
another for the part-type's id. Then I would have a load method in
Part. Would there be any particular reason why I wouldn't want to do
this?

By the way what is your code doing on line 15? I didn't really
understand that bit.

> What you want to do is really simple using a Module to define the
> properties and then including that module inside each Model that needs
> it, like this:
>
> http://gist.github.com/45667
--~--~---------~--~----~------------~-------~--~----~
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