Displaying 1 result from an estimated 1 matches for "castlea".
Did you mean:
castle
2009 Apr 28
1
help active record modeling.
...stlesCTable each have its unique
attributes.
In this case how can I represent this DB to AR?
I think
class Nation < ActiveRecord::Base
has_many :castles
end
class Castle < ActiveRecord::Base
belongs_to :Nations
end
but I''m not sure of what will be coded to these models.
class CastleA < ActiveRecord::Base
end
class CastleB < ActiveRecord::Base
end
class CastleB < ActiveRecord::Base
end
please help me.
and second question is
when nation deleted, CastleA, CastleB have to be deleted but not for
the castleC type.
how can I do?
thanks for reading.