2009-02-02 23:56:17 +01:00
|
|
|
class Card < CouchRest::ExtendedDocument
|
2009-02-03 04:21:32 +01:00
|
|
|
# Include the validation module to get access to the validation methods
|
|
|
|
include CouchRest::Validation
|
|
|
|
|
|
|
|
# Set the default database to use
|
2009-02-02 23:56:17 +01:00
|
|
|
use_database TEST_SERVER.default_database
|
2009-02-03 04:21:32 +01:00
|
|
|
|
|
|
|
# Official Schema
|
2009-02-02 23:56:17 +01:00
|
|
|
property :first_name
|
|
|
|
property :last_name, :alias => :family_name
|
|
|
|
property :read_only_value, :read_only => true
|
|
|
|
|
2009-02-04 02:33:31 +01:00
|
|
|
timestamps!
|
|
|
|
|
2009-02-03 04:21:32 +01:00
|
|
|
# Validation
|
|
|
|
validates_present :first_name
|
|
|
|
|
2009-02-06 02:06:12 +01:00
|
|
|
auto_validate!
|
|
|
|
|
2009-02-02 23:56:17 +01:00
|
|
|
end
|