Skip to content
This repository
Browse code

Better minimum validates_length_of examples (adapted from master).

  • Loading branch information...
commit 2229a7e8e81a71da6379d2e67d870f6897469953 1 parent 8fff8f0
Chris Strom authored
10  activerecord/lib/active_record/validations.rb
@@ -602,14 +602,14 @@ def validates_presence_of(*attr_names)
602 602
       # Validates that the specified attribute matches the length restrictions supplied. Only one option can be used at a time:
603 603
       #
604 604
       #   class Person < ActiveRecord::Base
605  
-      #     validates_length_of :first_name, :maximum=>30
606  
-      #     validates_length_of :last_name, :maximum=>30, :message=>"less than %{count} if you don't mind"
  605
+      #     validates_length_of :first_name, :maximum => 30
  606
+      #     validates_length_of :last_name, :maximum => 30, :message => "less than %{count} if you don't mind"
607 607
       #     validates_length_of :fax, :in => 7..32, :allow_nil => true
608 608
       #     validates_length_of :phone, :in => 7..32, :allow_blank => true
609 609
       #     validates_length_of :user_name, :within => 6..20, :too_long => "pick a shorter name", :too_short => "pick a longer name"
610  
-      #     validates_length_of :fav_bra_size, :minimum => 1, :too_short => "please enter at least %{count} character"
611  
-      #     validates_length_of :smurf_leader, :is => 4, :message => "papa is spelled with %{count} characters... don't play me."
612  
-      #     validates_length_of :essay, :minimum => 100, :too_short => "Your essay must be at least %{count} words."), :tokenizer => lambda {|str| str.scan(/\w+/) }
  610
+      #     validates_length_of :zip_code, :minimum => 5, :too_short => "please enter at least %{count} characters"
  611
+      #     validates_length_of :smurf_leader, :is => 4, :message => "papa is spelled with %{count} characters... don't play me"
  612
+      #     validates_length_of :essay, :minimum => 100, :too_short => "Your essay must be at least %{count} words"), :tokenizer => lambda {|str| str.scan(/\w+/) }
613 613
       #   end
614 614
       #
615 615
       # Configuration options:

0 notes on commit 2229a7e

Please sign in to comment.
Something went wrong with that request. Please try again.