2011-06-09 01:05:22 +02:00
|
|
|
require 'person'
|
|
|
|
|
2010-06-20 22:01:11 +02:00
|
|
|
class Card < 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
|
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
|
2010-06-16 22:02:12 +02:00
|
|
|
property :cast_alias, Person, :alias => :calias
|
2011-04-20 12:31:46 +02:00
|
|
|
property :fg_color, :default => '#000'
|
2009-06-08 03:51:31 +02:00
|
|
|
|
2009-02-04 02:33:31 +01:00
|
|
|
timestamps!
|
2011-04-20 12:31:46 +02:00
|
|
|
|
2009-02-03 04:21:32 +01:00
|
|
|
# Validation
|
2009-10-30 19:07:59 +01:00
|
|
|
validates_presence_of :first_name
|
2009-02-03 04:21:32 +01:00
|
|
|
|
2010-03-30 22:50:47 +02:00
|
|
|
end
|