aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/README3
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb2
-rw-r--r--activemodel/lib/active_model/errors.rb2
-rw-r--r--activemodel/lib/active_model/translation.rb2
-rw-r--r--activemodel/lib/active_model/validations.rb4
-rw-r--r--activemodel/lib/active_model/validations/validates.rb2
-rw-r--r--activemodel/lib/active_model/validator.rb4
7 files changed, 10 insertions, 9 deletions
diff --git a/activemodel/README b/activemodel/README
index 3945a6da06..6f162ef408 100644
--- a/activemodel/README
+++ b/activemodel/README
@@ -177,7 +177,8 @@ functionality from the following modules:
end
- person = Person.new(:first_name => 'zoolander')
+ person = Person.new
+ person.first_name = 'zoolander'
person.valid? #=> false
{Learn more}[link:classes/ActiveModel/Validations.html]
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index a7690ba5b9..817640b178 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -46,7 +46,7 @@ module ActiveModel
# end
# end
#
- # Notice that whenever you include ActiveModel::AtributeMethods in your class,
+ # Notice that whenever you include ActiveModel::AttributeMethods in your class,
# it requires you to implement a <tt>attributes</tt> methods which returns a hash
# with each attribute name in your model as hash key and the attribute value as
# hash value.
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index f4c7400621..9efb683547 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -246,7 +246,7 @@ module ActiveModel
# (e.g. <tt>activemodel.errors.messages.MESSAGE</tt>). The translated model name,
# translated attribute name and the value are available for interpolation.
#
- # When using inheritence in your models, it will check all the inherited
+ # When using inheritance in your models, it will check all the inherited
# models too, but only if the model itself hasn't been found. Say you have
# <tt>class Admin < User; end</tt> and you wanted the translation for
# the <tt>:blank</tt> error +message+ for the <tt>title</tt> +attribute+,
diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb
index 3228cfed9a..0554677296 100644
--- a/activemodel/lib/active_model/translation.rb
+++ b/activemodel/lib/active_model/translation.rb
@@ -13,7 +13,7 @@ module ActiveModel
# extend ActiveModel::Translation
# end
#
- # TranslatedPerson.human_attribute_name('my_attribue')
+ # TranslatedPerson.human_attribute_name('my_attribute')
# #=> "My attribute"
#
# This also provides the required class methods for hooking into the
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index 57487cf75a..36d89c2492 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -91,7 +91,7 @@ module ActiveModel
end
# Adds a validation method or block to the class. This is useful when
- # overriding the +validate+ instance method becomes too unwieldly and
+ # overriding the +validate+ instance method becomes too unwieldy and
# you're looking for more descriptive declaration of your validations.
#
# This can be done with a symbol pointing to a method:
@@ -176,7 +176,7 @@ module ActiveModel
!valid?(context)
end
- # Hook method defining how an attribute value should be retieved. By default
+ # Hook method defining how an attribute value should be retrieved. By default
# this is assumed to be an instance named after the attribute. Override this
# method in subclasses should you need to retrieve the value for a given
# attribute differently:
diff --git a/activemodel/lib/active_model/validations/validates.rb b/activemodel/lib/active_model/validations/validates.rb
index 90b244228a..57162996c2 100644
--- a/activemodel/lib/active_model/validations/validates.rb
+++ b/activemodel/lib/active_model/validations/validates.rb
@@ -20,7 +20,7 @@ module ActiveModel
# validates :username, :presence => true
# validates :username, :uniqueness => true
#
- # The power of the +validates+ method comes when using cusom validators
+ # The power of the +validates+ method comes when using custom validators
# and default validators in one call for a given attribute e.g.
#
# class EmailValidator < ActiveModel::EachValidator
diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb
index dd9e39843e..689c617177 100644
--- a/activemodel/lib/active_model/validator.rb
+++ b/activemodel/lib/active_model/validator.rb
@@ -109,7 +109,7 @@ module ActiveModel #:nodoc:
@kind ||= name.split('::').last.underscore.sub(/_validator$/, '').to_sym unless anonymous?
end
- # Accepts options that will be made availible through the +options+ reader.
+ # Accepts options that will be made available through the +options+ reader.
def initialize(options)
@options = options
end
@@ -155,7 +155,7 @@ module ActiveModel #:nodoc:
end
end
- # Override this method in subclasses with the validation logic, adding
+ # Override this method in subclasses with the validation logic, adding
# errors to the records +errors+ array where necessary.
def validate_each(record, attribute, value)
raise NotImplementedError