Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Doc fixes in 2.3: validates_length_of #5653

Merged
merged 1 commit into from

3 participants

@eee-c

Fix formatting / no period in message fragment / better example.

@rafaelfranca

Hey @eee-c you can commit documentation changes directly in the https://github.com/lifo/docrails. Thanks.

@fxn
Owner

There is no guarantee that there's a new 2.3 release, but if there is, a little better docs here do not hurt. In then, thank you!

@fxn fxn merged commit e8c0597 into rails:2-3-stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 5 deletions.
  1. +5 −5 activerecord/lib/active_record/validations.rb
View
10 activerecord/lib/active_record/validations.rb
@@ -602,14 +602,14 @@ def validates_presence_of(*attr_names)
# Validates that the specified attribute matches the length restrictions supplied. Only one option can be used at a time:
#
# class Person < ActiveRecord::Base
- # validates_length_of :first_name, :maximum=>30
- # validates_length_of :last_name, :maximum=>30, :message=>"less than %{count} if you don't mind"
+ # validates_length_of :first_name, :maximum => 30
+ # validates_length_of :last_name, :maximum => 30, :message => "less than %{count} if you don't mind"
# validates_length_of :fax, :in => 7..32, :allow_nil => true
# validates_length_of :phone, :in => 7..32, :allow_blank => true
# validates_length_of :user_name, :within => 6..20, :too_long => "pick a shorter name", :too_short => "pick a longer name"
- # validates_length_of :fav_bra_size, :minimum => 1, :too_short => "please enter at least %{count} character"
- # validates_length_of :smurf_leader, :is => 4, :message => "papa is spelled with %{count} characters... don't play me."
- # validates_length_of :essay, :minimum => 100, :too_short => "Your essay must be at least %{count} words."), :tokenizer => lambda {|str| str.scan(/\w+/) }
+ # validates_length_of :zip_code, :minimum => 5, :too_short => "please enter at least %{count} characters"
+ # validates_length_of :smurf_leader, :is => 4, :message => "papa is spelled with %{count} characters... don't play me"
+ # validates_length_of :essay, :minimum => 100, :too_short => "Your essay must be at least %{count} words"), :tokenizer => lambda {|str| str.scan(/\w+/) }
# end
#
# Configuration options:
Something went wrong with that request. Please try again.