When I automigrate these models I don't get the results I expect.
After migrating the person table now has included the fields from the
doctor table which seems incorrect to me as most of the entries in the
person table won't have 'doctor' properties.   My purpose of using STI
is to make it easier to create/update a doctor person.   The way I do
it now I save the person data and if that succeeds then I create an
entry in the doctor table with the corresponding person_id.   Any
help?


models/person.rb:
class Person
  include DataMapper::Resource

  property :id, Serial
  property :name, String
  property :address, Text
  property :type, Discriminator

end

class Doctor < Person; end


models/doctor.rb:
class Doctor < Person
  include DataMapper::Resource

  property :id, Serial
  property :person_id, Integer
  property :pay, Integer

  property :experience, Integer

end

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