Added ActiveRecord like after_initialize callback to ExtendedDocument

This commit is contained in:
Sam Lown 2010-03-03 20:01:27 +00:00
parent d992f44365
commit ca23e186f4
2 changed files with 20 additions and 0 deletions

View file

@ -58,6 +58,7 @@ module CouchRest
unless self['_id'] && self['_rev']
self['couchrest-type'] = self.class.to_s
end
after_initialize if respond_to?(:after_initialize)
end
# Defines an instance and save it directly to the database