On Sat, Jan 10, 2009 at 11:25 AM, Pat Maddox <[email protected]> wrote: > > I've got a DM::Resource class define in a gem, and then I subclass it > in an app of mine. It basically looks like: > > module Twinkies > class Item > include DataMapper::Resource > property :id, :serial => true > property :body, String > end > end > > class Item < Twinkies::Item > has n, :twitter_users > end > > When I run DM::auto_migrate! from the app, it creates id and body but > not twitter_user_id. I've also tried putting in a > "property :twitter_user_id, Integer" as well as a couple other test > fields, and they don't get created upon auto-migrate.
I put an inherited hook on the base class that adds any subclasses to the list of DM descendents. Then when I do DataMapper.auto_upgrade! it works fine. http://gist.github.com/45543 I don't know if this should be a part of DM::Resource itself or not...I know that ORM inheritance is a tricky thing and there's probably a reason why this isn't done automatically. Pat --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
