now using ActiveModel::Dirty. only writes to database if model.changed?

This commit is contained in:
Andrew Williams 2011-03-01 01:30:41 +10:30
parent 53b052f631
commit 4dbf694e51
14 changed files with 342 additions and 18 deletions

View file

@ -16,6 +16,7 @@ module CouchRest
include CouchRest::Model::PropertyProtection
include CouchRest::Model::Associations
include CouchRest::Model::Validations
include CouchRest::Model::Dirty
def self.subclasses
@subclasses ||= []
@ -55,7 +56,7 @@ module CouchRest
after_initialize if respond_to?(:after_initialize)
end
# Temp solution to make the view_by methods available
def self.method_missing(m, *args, &block)
if has_view?(m)