2010-06-20 22:01:11 +02:00
|
|
|
class Invoice < CouchRest::Model::Base
|
2009-02-02 19:21:32 -08:00
|
|
|
# Set the default database to use
|
2009-05-27 18:16:50 -07:00
|
|
|
use_database DB
|
2010-06-17 02:39:09 +02:00
|
|
|
|
2009-02-02 19:21:32 -08:00
|
|
|
# Official Schema
|
|
|
|
property :client_name
|
|
|
|
property :employee_name
|
|
|
|
property :location
|
|
|
|
|
|
|
|
# Validation
|
2009-10-30 16:07:59 -02:00
|
|
|
validates_presence_of :client_name, :employee_name
|
|
|
|
validates_presence_of :location, :message => "Hey stupid!, you forgot the location"
|
2009-02-02 19:21:32 -08:00
|
|
|
|
2010-06-17 02:39:09 +02:00
|
|
|
end
|