Integrated Yehuda's new callback code from rails
This commit is contained in:
parent
1c6e073b47
commit
dc4787e905
8 changed files with 228 additions and 221 deletions
|
@ -62,7 +62,7 @@ module CouchRest
|
|||
property(:updated_at, :read_only => true, :cast_as => 'Time', :auto_validation => false)
|
||||
property(:created_at, :read_only => true, :cast_as => 'Time', :auto_validation => false)
|
||||
|
||||
save_callback :before do |object|
|
||||
set_callback :save, :before do |object|
|
||||
object['updated_at'] = Time.now
|
||||
object['created_at'] = object['updated_at'] if object.new?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue