Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5067

Show
Ignore:
Timestamp:
09/07/06 21:34:35 (4 years ago)
Author:
bitsweat
Message:

Rollback [4917]. Closes #785.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r5018 r5067  
    1212 
    1313* Optimistic locking: gracefully handle nil versions, treat as zero.  #5908 [Tom Ward] 
    14  
    15 * validates_confirmation_of only kicks in when the attribute, rather than its confirmation, is present.  #785 [z@wzph.com] 
    1614 
    1715* to_xml: the :methods option works on arrays of records.  #5845 [Josh Starcher] 
  • trunk/activerecord/lib/active_record/validations.rb

    r5018 r5067  
    334334 
    335335        validates_each(attr_names, configuration) do |record, attr_name, value| 
    336           confirm = record.send("#{attr_name}_confirmation") 
    337           record.errors.add(attr_name, configuration[:message]) unless value.nil? || value == confirm 
     336          record.errors.add(attr_name, configuration[:message]) unless record.send("#{attr_name}_confirmation").nil? or value == record.send("#{attr_name}_confirmation") 
    338337        end 
    339338      end 
  • trunk/activerecord/test/validations_test.rb

    r4918 r5067  
    180180 
    181181    t.title_confirmation = "Parallel Lives" 
    182     assert t.valid? 
     182    assert !t.valid? 
    183183 
    184184    t.title_confirmation = nil 
    185185    t.title = "Parallel Lives" 
    186     assert !t.valid? 
     186    assert t.valid? 
    187187 
    188188    t.title_confirmation = "Parallel Lives"