Created
November 24, 2009 04:04
-
-
Save eedrummer/241619 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Extension | |
include DataMapper::Resource | |
property :id, Serial | |
property :type_id, String, :length => 200 | |
property :requirement, String | |
validates_is_unique :type_id, | |
:message => | |
"Extension with that type id already exists" | |
validates_format :requirement, | |
:with => /optional|mandatory/, | |
:message => | |
"Extension requirement must be optional or mandatory" | |
validates_present :type_id, :requirement, | |
:message => | |
"An extension must specify a typeId and requirement" | |
has n, :sections | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment