2010-06-20 22:01:11 +02:00
|
|
|
class Invoice < CouchRest::Model::Base
|
2009-02-03 04:21:32 +01:00
|
|
|
# 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
|
2011-06-09 01:05:22 +02:00
|
|
|
|
2009-02-03 04:21:32 +01:00
|
|
|
# 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"
|
2011-06-09 01:05:22 +02:00
|
|
|
|
2010-06-17 02:39:09 +02:00
|
|
|
end
|