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.
This commit is contained in:
Sam Lown 2010-06-20 22:01:11 +02:00
parent 9f1eea8d32
commit c280b3a29b
70 changed files with 1725 additions and 3733 deletions

View file

@ -1,22 +1,22 @@
require File.join(FIXTURE_PATH, 'more', 'question')
require File.join(FIXTURE_PATH, 'more', 'person')
class Course < CouchRest::ExtendedDocument
class Course < CouchRest::Model::Base
use_database TEST_SERVER.default_database
property :title, :cast_as => 'String'
property :questions, :cast_as => ['Question']
property :professor, :cast_as => 'Person'
property :participants, :type => ['Object']
property :ends_at, :type => 'Time'
property :estimate, :type => 'Float'
property :hours, :type => 'Integer'
property :profit, :type => 'BigDecimal'
property :started_on, :type => 'Date'
property :updated_at, :type => 'DateTime'
property :active, :type => 'Boolean'
property :title, String
property :questions, [Question]
property :professor, Person
property :participants, [Object]
property :ends_at, Time
property :estimate, Float
property :hours, Integer
property :profit, BigDecimal
property :started_on, :type => Date
property :updated_at, :type => DateTime
property :active, :type => TrueClass
property :very_active, :type => TrueClass
property :klass, :type => 'Class'
property :klass, :type => Class
view_by :title
view_by :title, :active