2009-02-03 04:21:32 +01:00
|
|
|
class Invoice < CouchRest::ExtendedDocument
|
|
|
|
# Include the validation module to get access to the validation methods
|
|
|
|
include CouchRest::Validation
|
|
|
|
|
|
|
|
# Set the default database to use
|
2009-05-28 03:16:50 +02:00
|
|
|
use_database DB
|
2009-02-03 04:21:32 +01:00
|
|
|
|
|
|
|
# Official Schema
|
|
|
|
property :client_name
|
|
|
|
property :employee_name
|
|
|
|
property :location
|
|
|
|
|
|
|
|
# Validation
|
|
|
|
validates_present :client_name, :employee_name
|
|
|
|
validates_present :location, :message => "Hey stupid!, you forgot the location"
|
|
|
|
|
|
|
|
end
|