aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-10-21 01:26:01 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-10-21 01:26:01 -0500
commitc9a88a2c26a0d9050e6106ef5e0617fe5c4cca24 (patch)
tree7db1fb1a457b3120ca573c999ea38f03cc368f75 /activemodel/lib/active_model/validations
parentaceb4a58a6cc5aecb49f91424926ccce19833a17 (diff)
downloadrails-c9a88a2c26a0d9050e6106ef5e0617fe5c4cca24.tar.gz
rails-c9a88a2c26a0d9050e6106ef5e0617fe5c4cca24.tar.bz2
rails-c9a88a2c26a0d9050e6106ef5e0617fe5c4cca24.zip
minor edits in AM documentation [ci skip]
Diffstat (limited to 'activemodel/lib/active_model/validations')
-rw-r--r--activemodel/lib/active_model/validations/acceptance.rb2
-rw-r--r--activemodel/lib/active_model/validations/callbacks.rb2
-rw-r--r--activemodel/lib/active_model/validations/confirmation.rb2
-rw-r--r--activemodel/lib/active_model/validations/exclusion.rb2
-rw-r--r--activemodel/lib/active_model/validations/inclusion.rb2
-rw-r--r--activemodel/lib/active_model/validations/length.rb6
-rw-r--r--activemodel/lib/active_model/validations/numericality.rb4
-rw-r--r--activemodel/lib/active_model/validations/presence.rb4
8 files changed, 12 insertions, 12 deletions
diff --git a/activemodel/lib/active_model/validations/acceptance.rb b/activemodel/lib/active_model/validations/acceptance.rb
index 8d5ebf527f..ec7ad4b048 100644
--- a/activemodel/lib/active_model/validations/acceptance.rb
+++ b/activemodel/lib/active_model/validations/acceptance.rb
@@ -1,6 +1,6 @@
module ActiveModel
- # == Active Model Acceptance Validator
+ # == Active \Model Acceptance \Validator
module Validations
class AcceptanceValidator < EachValidator #:nodoc:
def initialize(options)
diff --git a/activemodel/lib/active_model/validations/callbacks.rb b/activemodel/lib/active_model/validations/callbacks.rb
index c153ef4309..a8fb4fdfc2 100644
--- a/activemodel/lib/active_model/validations/callbacks.rb
+++ b/activemodel/lib/active_model/validations/callbacks.rb
@@ -2,7 +2,7 @@ require 'active_support/callbacks'
module ActiveModel
module Validations
- # == Active Model Validation callbacks
+ # == Active \Model Validation Callbacks
#
# Provides an interface for any class to have +before_validation+ and
# +after_validation+ callbacks.
diff --git a/activemodel/lib/active_model/validations/confirmation.rb b/activemodel/lib/active_model/validations/confirmation.rb
index baa034eca6..4071589747 100644
--- a/activemodel/lib/active_model/validations/confirmation.rb
+++ b/activemodel/lib/active_model/validations/confirmation.rb
@@ -1,6 +1,6 @@
module ActiveModel
- # == Active Model Confirmation Validator
+ # == Active \Model Confirmation \Validator
module Validations
class ConfirmationValidator < EachValidator #:nodoc:
def validate_each(record, attribute, value)
diff --git a/activemodel/lib/active_model/validations/exclusion.rb b/activemodel/lib/active_model/validations/exclusion.rb
index 3ec552c372..7a90750c49 100644
--- a/activemodel/lib/active_model/validations/exclusion.rb
+++ b/activemodel/lib/active_model/validations/exclusion.rb
@@ -2,7 +2,7 @@ require "active_model/validations/clusivity"
module ActiveModel
- # == Active Model Exclusion Validator
+ # == Active \Model Exclusion \Validator
module Validations
class ExclusionValidator < EachValidator #:nodoc:
include Clusivity
diff --git a/activemodel/lib/active_model/validations/inclusion.rb b/activemodel/lib/active_model/validations/inclusion.rb
index babc8982da..a333a09976 100644
--- a/activemodel/lib/active_model/validations/inclusion.rb
+++ b/activemodel/lib/active_model/validations/inclusion.rb
@@ -2,7 +2,7 @@ require "active_model/validations/clusivity"
module ActiveModel
- # == Active Model Inclusion Validator
+ # == Active \Model Inclusion \Validator
module Validations
class InclusionValidator < EachValidator #:nodoc:
include Clusivity
diff --git a/activemodel/lib/active_model/validations/length.rb b/activemodel/lib/active_model/validations/length.rb
index e4a1f9e80a..70ef589cd7 100644
--- a/activemodel/lib/active_model/validations/length.rb
+++ b/activemodel/lib/active_model/validations/length.rb
@@ -1,8 +1,8 @@
module ActiveModel
- # == Active Model Length Validator
+ # == Active \Model Length \Validator
module Validations
- class LengthValidator < EachValidator #:nodoc:
+ class LengthValidator < EachValidator # :nodoc:
MESSAGES = { :is => :wrong_length, :minimum => :too_short, :maximum => :too_long }.freeze
CHECKS = { :is => :==, :minimum => :>=, :maximum => :<= }.freeze
@@ -37,7 +37,7 @@ module ActiveModel
value = tokenize(value)
value_length = value.respond_to?(:length) ? value.length : value.to_s.length
errors_options = options.except(*RESERVED_OPTIONS)
-
+
CHECKS.each do |key, validity_check|
next unless check_value = options[key]
next if value_length.send(validity_check, check_value)
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb
index edebca94a8..ffd045a8fb 100644
--- a/activemodel/lib/active_model/validations/numericality.rb
+++ b/activemodel/lib/active_model/validations/numericality.rb
@@ -1,8 +1,8 @@
module ActiveModel
- # == Active Model Numericality Validator
+ # == Active \Model Numericality \Validator
module Validations
- class NumericalityValidator < EachValidator #:nodoc:
+ class NumericalityValidator < EachValidator # :nodoc:
CHECKS = { :greater_than => :>, :greater_than_or_equal_to => :>=,
:equal_to => :==, :less_than => :<, :less_than_or_equal_to => :<=,
:odd => :odd?, :even => :even?, :other_than => :!= }.freeze
diff --git a/activemodel/lib/active_model/validations/presence.rb b/activemodel/lib/active_model/validations/presence.rb
index f159e40858..70247ee4c8 100644
--- a/activemodel/lib/active_model/validations/presence.rb
+++ b/activemodel/lib/active_model/validations/presence.rb
@@ -1,9 +1,9 @@
module ActiveModel
- # == Active Model Presence Validator
+ # == Active \Model Presence \Validator
module Validations
- class PresenceValidator < EachValidator #:nodoc:
+ class PresenceValidator < EachValidator # :nodoc:
def validate(record)
record.errors.add_on_blank(attributes, options)
end