2009-02-25 09:22:11 +01:00
|
|
|
require File.join(FIXTURE_PATH, 'more', 'question')
|
|
|
|
require File.join(FIXTURE_PATH, 'more', 'person')
|
|
|
|
|
|
|
|
class Course < CouchRest::ExtendedDocument
|
|
|
|
use_database TEST_SERVER.default_database
|
|
|
|
|
2010-03-03 03:18:32 +01:00
|
|
|
property :title, :cast_as => 'String'
|
2009-07-20 23:17:27 +02:00
|
|
|
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'
|
2010-05-21 23:00:19 +02:00
|
|
|
property :very_active, :type => TrueClass
|
2009-07-20 23:17:27 +02:00
|
|
|
property :klass, :type => 'Class'
|
2009-02-25 09:22:11 +01:00
|
|
|
|
|
|
|
view_by :title
|
|
|
|
view_by :dept, :ducktype => true
|
2010-03-03 03:18:32 +01:00
|
|
|
end
|