attempt to merge wildchild/type_cast, still failing specs

This commit is contained in:
Will Leinweber 2010-02-17 16:35:42 -06:00
commit 15ea10eb9c
12 changed files with 652 additions and 150 deletions

View file

@ -73,9 +73,9 @@ module CouchRest
# on the document whenever saving occurs. CouchRest uses a pretty
# decent time format by default. See Time#to_json
def self.timestamps!
class_eval <<-EOS, __FILE__, __LINE__ + 1
property(:updated_at, :read_only => true, :cast_as => 'Time', :auto_validation => false)
property(:created_at, :read_only => true, :cast_as => 'Time', :auto_validation => false)
class_eval <<-EOS, __FILE__, __LINE__
property(:updated_at, :read_only => true, :type => 'Time', :auto_validation => false)
property(:created_at, :read_only => true, :type => 'Time', :auto_validation => false)
set_callback :save, :before do |object|
object['updated_at'] = Time.now