couchrest_model/spec/fixtures/more/invoice.rb
Sam Lown c280b3a29b Renaming to CouchRest Model
Refactored basic directory structure.
Moved to ActiveSupport for Validations and Callbacks.
Cleaned up older code, and removed support for text property types.
2010-06-20 22:01:11 +02:00

14 lines
349 B
Ruby

class Invoice < CouchRest::Model::Base
# Set the default database to use
use_database DB
# Official Schema
property :client_name
property :employee_name
property :location
# Validation
validates_presence_of :client_name, :employee_name
validates_presence_of :location, :message => "Hey stupid!, you forgot the location"
end