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

Ticket #9995: pedantic_doc_fix.diff

File pedantic_doc_fix.diff, 0.7 kB (added by jeremymcanally, 8 months ago)

Properly formed patch file

  • activerecord/lib/active_record/validations.rb

    old new  
    239239  #     protected 
    240240  #       def validate 
    241241  #         errors.add_on_empty %w( first_name last_name ) 
    242   #         errors.add("phone_number", "has invalid format") unless phone_number =~ /[0-9]*
     242  #         errors.add("phone_number", "has invalid format") unless phone_number =~ /^[0-9\-]*$
    243243  #       end 
    244244  # 
    245245  #       def validate_on_create # is only run the first time a new object is saved