From c175563b88a2114258120cacaf3f4bce5a615736 Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Tue, 10 Jul 2012 10:07:38 +0300 Subject: AM::Validations: remove documentation duplicates --- activemodel/lib/active_model/validations/length.rb | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'activemodel/lib/active_model/validations/length.rb') diff --git a/activemodel/lib/active_model/validations/length.rb b/activemodel/lib/active_model/validations/length.rb index 3b0be96ac6..aa72ea41c7 100644 --- a/activemodel/lib/active_model/validations/length.rb +++ b/activemodel/lib/active_model/validations/length.rb @@ -96,24 +96,14 @@ module ActiveModel # * :message - The error message to use for a :minimum, # :maximum, or :is violation. An alias of the appropriate # too_long/too_short/wrong_length message. - # * :on - Specifies when this validation is active. Runs in all - # validation contexts by default (+nil+), other options are :create - # and :update. - # * :if - Specifies a method, proc or string to call to determine if - # the validation should occur (e.g. if: :allow_validation, or - # if: Proc.new { |user| user.signup_step > 2 }). The method, - # proc or string should return or evaluate to a +true+ or +false+ value. - # * :unless - Specifies a method, proc or string to call to determine - # if the validation should not occur (e.g. unless: :skip_validation, - # or unless: Proc.new { |user| user.signup_step <= 2 }). The - # method, proc or string should return or evaluate to a +true+ or - # +false+ value. # * :tokenizer - Specifies how to split up the attribute string. # (e.g. tokenizer: ->(str) { str.scan(/\w+/) } to count words # as in above example). Defaults to ->(value) { value.split(//) } # which counts individual characters. - # * :strict - Specifies whether validation should be strict. - # See ActiveModel::Validation#validates! for more information. + # + # There is also a list of default options supported by every validator: + # +:if+, +:unless+, +:on+ and +:strict+. + # See ActiveModel::Validation#validates for more information def validates_length_of(*attr_names) validates_with LengthValidator, _merge_attributes(attr_names) end -- cgit v1.2.3