fixed a bug with validation

This commit is contained in:
Matt Aimonetti 2009-02-20 18:32:01 -08:00
parent 2f8caa8740
commit 72542dc876
3 changed files with 2 additions and 6 deletions

View file

@ -2,7 +2,7 @@
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{couchrest} s.name = %q{couchrest}
s.version = "0.14.1" s.version = "0.14.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["J. Chris Anderson", "Matt Aimonetti"] s.authors = ["J. Chris Anderson", "Matt Aimonetti"]

View file

@ -27,7 +27,7 @@ require 'couchrest/monkeypatches'
# = CouchDB, close to the metal # = CouchDB, close to the metal
module CouchRest module CouchRest
VERSION = '0.14.1' VERSION = '0.14.2'
autoload :Server, 'couchrest/core/server' autoload :Server, 'couchrest/core/server'
autoload :Database, 'couchrest/core/database' autoload :Database, 'couchrest/core/database'

View file

@ -52,10 +52,6 @@ module CouchRest
return true if @options[:allow_nil] && field_value.nil? return true if @options[:allow_nil] && field_value.nil?
return false if !@options[:allow_nil] && field_value.nil? return false if !@options[:allow_nil] && field_value.nil?
if target.class.properties.has_property?(field_name)
return true unless target.attribute_dirty?(field_name)
end
confirm_value = target.instance_variable_get("@#{@confirm_field_name}") confirm_value = target.instance_variable_get("@#{@confirm_field_name}")
field_value == confirm_value field_value == confirm_value
end end