Created
September 20, 2010 07:57
-
-
Save WaYdotNET/587570 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Component | |
include DataMapper::Resource | |
property :id, Serial | |
property :nome, String | |
property :descrizione, Text | |
property :prezzo_base, Float | |
property :base, Boolean | |
has n, :plant_types, :through => Resource | |
belongs_to :supplier | |
belongs_to :component_type | |
end | |
class Supplier | |
include DataMapper::Resource | |
property :id, Serial | |
property :nome, String | |
property :ragione_sociale, String | |
property :piva, String | |
property :cf, String | |
has n, :components | |
end | |
class ComponentType | |
include DataMapper::Resource | |
property :id, Serial | |
property :nome, String | |
property :note, Text | |
has n, :components | |
end | |
class PlantType | |
include DataMapper::Resource | |
property :id, Serial | |
property :nome, String #, :required => true, :unique => true | |
has n, :components, :through => Resource | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment