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
|
2010-06-17 02:39:09 +02:00
|
|
|
|
2009-02-03 04:21:32 +01:00
|
|
|
# Official Schema
|
|
|
|
property :client_name
|
|
|
|
property :employee_name
|
|
|
|
property :location
|
|
|
|
|
|
|
|
# Validation
|
2009-10-30 19:07:59 +01:00
|
|
|
validates_presence_of :client_name, :employee_name
|
|
|
|
validates_presence_of :location, :message => "Hey stupid!, you forgot the location"
|
2009-02-03 04:21:32 +01:00
|
|
|
|
2010-06-17 02:39:09 +02:00
|
|
|
end
|