aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionmailer/lib/action_mailer/base.rb4
-rw-r--r--actionpack/lib/action_controller.rb2
-rw-r--r--actionpack/lib/action_controller/metal/instrumentation.rb2
-rw-r--r--actionpack/lib/action_view/context.rb6
-rw-r--r--actionpack/lib/action_view/helpers/sanitize_helper.rb2
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb4
-rw-r--r--actionpack/test/controller/helper_test.rb2
-rw-r--r--actionpack/test/controller/render_test.rb2
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb54
-rw-r--r--activemodel/lib/active_model/callbacks.rb14
-rw-r--r--activemodel/lib/active_model/conversion.rb18
-rw-r--r--activemodel/lib/active_model/dirty.rb17
-rw-r--r--activemodel/lib/active_model/errors.rb24
-rw-r--r--activemodel/lib/active_model/lint.rb6
-rw-r--r--activemodel/lib/active_model/locale/en.yml2
-rw-r--r--activemodel/lib/active_model/naming.rb8
-rw-r--r--activemodel/lib/active_model/observing.rb4
-rw-r--r--activemodel/lib/active_model/serialization.rb2
-rw-r--r--activemodel/lib/active_model/serializers/json.rb5
-rw-r--r--activemodel/lib/active_model/serializers/xml.rb3
-rw-r--r--activemodel/lib/active_model/translation.rb16
-rw-r--r--activemodel/lib/active_model/validations.rb40
-rw-r--r--activemodel/lib/active_model/validator.rb5
-rw-r--r--activerecord/lib/active_record/association_preload.rb12
-rwxr-xr-xactiverecord/lib/active_record/associations.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb12
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb2
-rwxr-xr-xactiverecord/lib/active_record/connection_adapters/abstract_adapter.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb6
-rw-r--r--activerecord/lib/active_record/locale/en.yml2
-rw-r--r--activerecord/test/cases/defaults_test.rb2
-rw-r--r--activeresource/test/cases/base_test.rb2
-rw-r--r--activeresource/test/cases/finder_test.rb2
-rw-r--r--activesupport/lib/active_support/callbacks.rb63
-rw-r--r--activesupport/lib/active_support/xml_mini/rexml.rb2
-rw-r--r--ci/site_config.rb4
-rw-r--r--railties/guides/source/configuring.textile12
-rw-r--r--railties/lib/rails.rb2
-rw-r--r--railties/lib/rails/log_subscriber.rb2
-rw-r--r--railties/lib/rails/log_subscriber/test_helper.rb2
-rw-r--r--railties/lib/rails/railtie.rb2
-rw-r--r--railties/lib/rails/test_unit/testing.rake2
-rw-r--r--railties/test/application/initializers/notifications_test.rb2
43 files changed, 225 insertions, 158 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 8c5c838384..9e3437685d 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -209,7 +209,7 @@ module ActionMailer #:nodoc:
#
# <%= image_tag attachments['photo.png'].url -%>
#
- # As we are using ActionView's +image_tag+ method, you can pass in any other options you want:
+ # As we are using Action View's +image_tag+ method, you can pass in any other options you want:
#
# <h1>Please Don't Cringe</h1>
#
@@ -739,7 +739,7 @@ module ActionMailer #:nodoc:
end
# This module will complain if the user tries to set default_url_options
- # directly instead of through the config object. In ActionMailer's Railtie,
+ # directly instead of through the config object. In Action Mailer's Railtie,
# we include the url_helpers of the router, which will override this module
extend DeprecatedUrlOptions
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb
index c14393dda7..1bd4572a47 100644
--- a/actionpack/lib/action_controller.rb
+++ b/actionpack/lib/action_controller.rb
@@ -67,7 +67,7 @@ end
require 'action_view'
require 'action_controller/vendor/html-scanner'
-# Common ActiveSupport usage in ActionController
+# Common Active Support usage in Action Controller
require 'active_support/concern'
require 'active_support/core_ext/class/attribute_accessors'
require 'active_support/core_ext/load_error'
diff --git a/actionpack/lib/action_controller/metal/instrumentation.rb b/actionpack/lib/action_controller/metal/instrumentation.rb
index ba38b186d6..b2c119d7e4 100644
--- a/actionpack/lib/action_controller/metal/instrumentation.rb
+++ b/actionpack/lib/action_controller/metal/instrumentation.rb
@@ -2,7 +2,7 @@ require 'abstract_controller/logger'
module ActionController
# Adds instrumentation to several ends in ActionController::Base. It also provides
- # some hooks related with process_action, this allows an ORM like ActiveRecord
+ # some hooks related with process_action, this allows an ORM like Active Record
# and/or DataMapper to plug in ActionController and show related information.
#
# Check ActiveRecord::Railties::ControllerRuntime for an example.
diff --git a/actionpack/lib/action_view/context.rb b/actionpack/lib/action_view/context.rb
index 61d2e702a7..88efd4b34f 100644
--- a/actionpack/lib/action_view/context.rb
+++ b/actionpack/lib/action_view/context.rb
@@ -3,8 +3,8 @@ module ActionView
# holds compiled template code
end
- # ActionView contexts are supplied to ActionController
- # to render template. The default ActionView context
+ # Action View contexts are supplied to Action Controller
+ # to render template. The default Action View context
# is ActionView::Base.
#
# In order to work with ActionController, a Context
@@ -21,7 +21,7 @@ module ActionView
# options<Hash>:: See _render_template_with_layout in ActionView::Base
# partial<Boolean>:: Whether or not the template to render is a partial
#
- # An ActionView context can also mix in ActionView's
+ # An Action View context can also mix in Action View's
# helpers. In order to mix in helpers, a context must
# implement:
#
diff --git a/actionpack/lib/action_view/helpers/sanitize_helper.rb b/actionpack/lib/action_view/helpers/sanitize_helper.rb
index 28e40f8560..f173523f6a 100644
--- a/actionpack/lib/action_view/helpers/sanitize_helper.rb
+++ b/actionpack/lib/action_view/helpers/sanitize_helper.rb
@@ -4,7 +4,7 @@ require 'action_view/helpers/tag_helper'
module ActionView
module Helpers #:nodoc:
# The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements.
- # These helper methods extend ActionView making them callable within your template files.
+ # These helper methods extend Action View making them callable within your template files.
module SanitizeHelper
# This +sanitize+ helper will html encode all tags and strip all attributes that aren't specifically allowed.
# It also strips href/src tags with invalid protocols, like javascript: especially. It does its best to counter any
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index cefabd72aa..3b37fd6b57 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -6,7 +6,7 @@ module ActionView
module Helpers #:nodoc:
# The TextHelper module provides a set of methods for filtering, formatting
# and transforming strings, which can reduce the amount of inline Ruby code in
- # your views. These helper methods extend ActionView making them callable
+ # your views. These helper methods extend Action View making them callable
# within your template files.
module TextHelper
# The preferred method of outputting text in your views is to use the
@@ -39,7 +39,7 @@ module ActionView
# for a total length not exceeding <tt>:length</tt>.
#
# Pass a <tt>:separator</tt> to truncate +text+ at a natural break.
- # Pass a <tt>:safe</tt> (which defaults to false) to escape or not the input. If :safe => true the input is not escaped.
+ # Pass a <tt>:safe</tt> value as "true" to not to escape the content.
#
# ==== Examples
#
diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb
index 75a96d6497..c9a6e5dd45 100644
--- a/actionpack/test/controller/helper_test.rb
+++ b/actionpack/test/controller/helper_test.rb
@@ -122,7 +122,7 @@ class HelperTest < ActiveSupport::TestCase
def test_helper_proxy
methods = AllHelpersController.helpers.methods.map(&:to_s)
- # ActionView
+ # Action View
assert methods.include?('pluralize')
# abc_helper.rb
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 2b1f2a27df..e3ed097c67 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -275,7 +275,7 @@ class TestController < ActionController::Base
render :action => "hello", :layout => "layouts/builder"
end
- # :move: test this in ActionView
+ # :move: test this in Action View
def builder_partial_test
render :action => "hello_world_container"
end
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index 9bacc2a511..a7690ba5b9 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -4,12 +4,13 @@ require 'active_support/core_ext/class/inheritable_attributes'
module ActiveModel
class MissingAttributeError < NoMethodError
end
-
+ # == Active Model Attribute Methods
+ #
# <tt>ActiveModel::AttributeMethods</tt> provides a way to add prefixes and suffixes
# to your methods as well as handling the creation of Active Record like class methods
# such as +table_name+.
#
- # The requirements to implement ActiveModel::AttributeMethods are:
+ # The requirements to implement ActiveModel::AttributeMethods are to:
#
# * <tt>include ActiveModel::AttributeMethods</tt> in your object
# * Call each Attribute Method module method you want to add, such as
@@ -45,24 +46,26 @@ module ActiveModel
# end
# end
#
- # Please notice that whenever you include ActiveModel::AtributeMethods 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.
- # Hash keys must be a string.
+ # Notice that whenever you include ActiveModel::AtributeMethods 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.
+ #
+ # Hash keys must be strings.
#
module AttributeMethods
extend ActiveSupport::Concern
module ClassMethods
- # Defines an "attribute" method (like +inheritance_column+ or
- # +table_name+). A new (class) method will be created with the
- # given name. If a value is specified, the new method will
- # return that value (as a string). Otherwise, the given block
- # will be used to compute the value of the method.
+ # Defines an "attribute" method (like +inheritance_column+ or +table_name+).
+ # A new (class) method will be created with the given name. If a value is
+ # specified, the new method will return that value (as a string).
+ # Otherwise, the given block will be used to compute the value of the
+ # method.
#
- # The original method will be aliased, with the new name being
- # prefixed with "original_". This allows the new method to
- # access the original value.
+ # The original method will be aliased, with the new name being prefixed
+ # with "original_". This allows the new method to access the original
+ # value.
#
# Example:
#
@@ -115,8 +118,8 @@ module ActiveModel
#
# #{prefix}attribute(#{attr}, *args, &block)
#
- # An <tt>#{prefix}attribute</tt> instance method must exist and accept at least
- # the +attr+ argument.
+ # An instance method <tt>#{prefix}attribute</tt> must exist and accept
+ # at least the +attr+ argument.
#
# For example:
#
@@ -341,14 +344,17 @@ module ActiveModel
end
end
- # Allows access to the object attributes, which are held in the <tt>@attributes</tt> hash, as though they
- # were first-class methods. So a Person class with a name attribute can use Person#name and
- # Person#name= and never directly use the attributes hash -- except for multiple assigns with
- # ActiveRecord#attributes=. A Milestone class can also ask Milestone#completed? to test that
- # the completed attribute is not +nil+ or 0.
+ # Allows access to the object attributes, which are held in the
+ # <tt>@attributes</tt> hash, as though they were first-class methods. So a
+ # Person class with a name attribute can use Person#name and Person#name=
+ # and never directly use the attributes hash -- except for multiple assigns
+ # with ActiveRecord#attributes=. A Milestone class can also ask
+ # Milestone#completed? to test that the completed attribute is not +nil+
+ # or 0.
#
- # It's also possible to instantiate related objects, so a Client class belonging to the clients
- # table with a +master_id+ foreign key can instantiate master through Client#master.
+ # It's also possible to instantiate related objects, so a Client class
+ # belonging to the clients table with a +master_id+ foreign key can
+ # instantiate master through Client#master.
def method_missing(method_id, *args, &block)
method_name = method_id.to_s
if match = match_attribute_method?(method_name)
@@ -367,7 +373,7 @@ module ActiveModel
return true
elsif !include_private_methods && super(method, true)
# If we're here then we haven't found among non-private methods
- # but found among all methods. Which means that given method is private.
+ # but found among all methods. Which means that the given method is private.
return false
elsif match_attribute_method?(method.to_s)
return true
diff --git a/activemodel/lib/active_model/callbacks.rb b/activemodel/lib/active_model/callbacks.rb
index ad12600d7c..257644b3fa 100644
--- a/activemodel/lib/active_model/callbacks.rb
+++ b/activemodel/lib/active_model/callbacks.rb
@@ -2,7 +2,7 @@ require 'active_support/core_ext/array/wrap'
require 'active_support/callbacks'
module ActiveModel
- # == Active Model Callbacks
+ # == Active Model Call Backs
#
# Provides an interface for any class to have Active Record like callbacks.
#
@@ -41,7 +41,7 @@ module ActiveModel
# # Your code here
# end
#
- # You can choose not to have all three callbacks by passing an hash to the
+ # You can choose not to have all three callbacks by passing a hash to the
# define_model_callbacks method.
#
# define_model_callbacks :create, :only => :after, :before
@@ -55,13 +55,13 @@ module ActiveModel
end
end
- # define_model_callbacks accepts all options define_callbacks does, in case you
- # want to overwrite a default. Besides that, it also accepts an :only option,
+ # define_model_callbacks accepts the same options define_callbacks does, in case
+ # you want to overwrite a default. Besides that, it also accepts an :only option,
# where you can choose if you want all types (before, around or after) or just some.
#
# define_model_callbacks :initializer, :only => :after
#
- # Note, the <tt>:only => <type></tt> hash will apply to all callbacks defined on
+ # Note, the <tt>:only => <type></tt> hash will apply to all call backs defined on
# that method call. To get around this you can call the define_model_callbacks
# method as many times as you need.
#
@@ -73,7 +73,7 @@ module ActiveModel
#
# You can pass in a class to before_<type>, after_<type> and around_<type>, in which
# case the call back will call that class's <action>_<type> method passing the object
- # that the callback is being called on.
+ # that the call back is being called on.
#
# class MyModel
# extend ActiveModel::Callbacks
@@ -84,7 +84,7 @@ module ActiveModel
#
# class AnotherClass
# def self.before_create( obj )
- # # obj is the MyModel instance that the callback is being called on
+ # # obj is the MyModel instance that the call back is being called on
# end
# end
#
diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb
index 23724b2d95..2a1650faa9 100644
--- a/activemodel/lib/active_model/conversion.rb
+++ b/activemodel/lib/active_model/conversion.rb
@@ -1,5 +1,7 @@
module ActiveModel
- # Handle default conversions: to_model, to_key and to_param.
+ # == Active Model Conversions
+ #
+ # Handles default conversions: to_model, to_key and to_param.
#
# == Example
#
@@ -20,17 +22,19 @@ module ActiveModel
# cm.to_param #=> nil
#
module Conversion
- # If your object is already designed to implement all of the Active Model you can use
- # the default to_model implementation, which simply returns self.
+ # If your object is already designed to implement all of the Active Model
+ # you can use the default to_model implementation, which simply returns
+ # self.
#
- # If your model does not act like an Active Model object, then you should define
- # <tt>:to_model</tt> yourself returning a proxy object that wraps your object
- # with Active Model compliant methods.
+ # If your model does not act like an Active Model object, then you should
+ # define <tt>:to_model</tt> yourself returning a proxy object that wraps
+ # your object with Active Model compliant methods.
def to_model
self
end
- # Returns an Enumerable of all (primary) key attributes or nil if persisted? is false
+ # Returns an Enumerable of all (primary) key attributes or nil if
+ # persisted? is false
def to_key
persisted? ? [id] : nil
end
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb
index bbcc345e4b..a82ce1bee0 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -4,16 +4,21 @@ require 'active_support/hash_with_indifferent_access'
require 'active_support/core_ext/object/duplicable'
module ActiveModel
- # <tt>ActiveModel::Dirty</tt> provides a way to track changes in your
- # object in the same way as ActiveRecord does.
+ # == Active Model Call Backs
+ #
+ # Provides a way to track changes in your object in the same way as
+ # Active Record does.
#
- # The requirements to implement ActiveModel::Dirty are:
+ # The requirements to implement ActiveModel::Dirty are to:
#
# * <tt>include ActiveModel::Dirty</tt> in your object
- # * Call <tt>define_attribute_methods</tt> passing each method you want to track
- # * Call <tt>attr_name_will_change!</tt> before each change to the tracked attribute
+ # * Call <tt>define_attribute_methods</tt> passing each method you want to
+ # track
+ # * Call <tt>attr_name_will_change!</tt> before each change to the tracked
+ # attribute
#
- # If you wish to also track previous changes on save or update, you need to add
+ # If you wish to also track previous changes on save or update, you need to
+ # add
#
# @previously_changed = changes
#
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 15d468f5d8..f4c7400621 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -6,6 +6,8 @@ require 'active_support/core_ext/object/blank'
require 'active_support/ordered_hash'
module ActiveModel
+ # == Active Model Errors
+ #
# Provides a modified +OrderedHash+ that you can include in your object
# for handling error messages and interacting with Action Pack helpers.
#
@@ -74,7 +76,8 @@ module ActiveModel
alias_method :get, :[]
alias_method :set, :[]=
- # When passed a symbol or a name of a method, returns an array of errors for the method.
+ # When passed a symbol or a name of a method, returns an array of errors
+ # for the method.
#
# p.errors[:name] #=> ["can not be nil"]
# p.errors['name'] #=> ["can not be nil"]
@@ -234,15 +237,20 @@ module ActiveModel
full_messages
end
- # Translates an error message in its default scope (<tt>activemodel.errors.messages</tt>).
- # Error messages are first looked up in <tt>models.MODEL.attributes.ATTRIBUTE.MESSAGE</tt>, if it's not there,
- # it's looked up in <tt>models.MODEL.MESSAGE</tt> and if that is not there it returns the translation of the
- # default message (e.g. <tt>activemodel.errors.messages.MESSAGE</tt>). The translated model name,
+ # Translates an error message in its default scope
+ # (<tt>activemodel.errors.messages</tt>).
+ #
+ # Error messages are first looked up in <tt>models.MODEL.attributes.ATTRIBUTE.MESSAGE</tt>,
+ # if it's not there, it's looked up in <tt>models.MODEL.MESSAGE</tt> and if that is not
+ # there also, it returns the translation of the default message
+ # (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 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+, it looks for these translations:
+ # When using inheritence 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+,
+ # it looks for these translations:
#
# <ol>
# <li><tt>activemodel.errors.models.admin.attributes.title.blank</tt></li>
diff --git a/activemodel/lib/active_model/lint.rb b/activemodel/lib/active_model/lint.rb
index 13ddb622d1..a5977bf3cc 100644
--- a/activemodel/lib/active_model/lint.rb
+++ b/activemodel/lib/active_model/lint.rb
@@ -1,5 +1,7 @@
-# You can test whether an object is compliant with the ActiveModel API by
-# including ActiveModel::Lint::Tests in your TestCase. It will included
+# == Active Model Lint Tests
+#
+# You can test whether an object is compliant with the Active Model API by
+# including <tt>ActiveModel::Lint::Tests</tt> in your TestCase. It will include
# tests that tell you whether your object is fully compliant, or if not,
# which aspects of the API are not implemented.
#
diff --git a/activemodel/lib/active_model/locale/en.yml b/activemodel/lib/active_model/locale/en.yml
index 602a530dc0..44425b4a28 100644
--- a/activemodel/lib/active_model/locale/en.yml
+++ b/activemodel/lib/active_model/locale/en.yml
@@ -1,6 +1,6 @@
en:
errors:
- # The default format use in full error messages.
+ # The default format to use in full error messages.
format: "%{attribute} %{message}"
# The values :model, :attribute and :value are always available for interpolation
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb
index 8cdd3d2fe8..ca1e9f0ee8 100644
--- a/activemodel/lib/active_model/naming.rb
+++ b/activemodel/lib/active_model/naming.rb
@@ -1,7 +1,6 @@
require 'active_support/inflector'
module ActiveModel
-
class Name < String
attr_reader :singular, :plural, :element, :collection, :partial_path
alias_method :cache_key, :collection
@@ -36,8 +35,9 @@ module ActiveModel
end
end
- # ActiveModel::Naming is a module that creates a +model_name+ method on your
- # object.
+ # == Active Model Naming
+ #
+ # Creates a +model_name+ method on your object.
#
# To implement, just extend ActiveModel::Naming in your object:
#
@@ -49,7 +49,7 @@ module ActiveModel
# BookCover.model_name.human #=> "Book cover"
#
# Providing the functionality that ActiveModel::Naming provides in your object
- # is required to pass the ActiveModel Lint test. So either extending the provided
+ # is required to pass the Active Model Lint test. So either extending the provided
# method below, or rolling your own is required..
module Naming
# Returns an ActiveModel::Name object for module. It can be
diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb
index d7e3ca100e..14f8bf72dc 100644
--- a/activemodel/lib/active_model/observing.rb
+++ b/activemodel/lib/active_model/observing.rb
@@ -9,6 +9,8 @@ module ActiveModel
extend ActiveSupport::Concern
module ClassMethods
+ # == Active Model Observers Activation
+ #
# Activates the observers assigned. Examples:
#
# # Calls PersonObserver.instance
@@ -89,6 +91,8 @@ module ActiveModel
end
end
+ # == Active Model Observers
+ #
# Observer classes respond to lifecycle callbacks to implement trigger-like
# behavior outside the original class. This is a great way to reduce the
# clutter that normally comes when the model class is burdened with
diff --git a/activemodel/lib/active_model/serialization.rb b/activemodel/lib/active_model/serialization.rb
index 1c48d4613a..5670ec74cb 100644
--- a/activemodel/lib/active_model/serialization.rb
+++ b/activemodel/lib/active_model/serialization.rb
@@ -2,6 +2,8 @@ require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/hash/slice'
module ActiveModel
+ # == Active Model Serialization
+ #
# Provides a basic serialization to a serializable_hash for your object.
#
# A minimal implementation could be:
diff --git a/activemodel/lib/active_model/serializers/json.rb b/activemodel/lib/active_model/serializers/json.rb
index 90305978c4..918cd0ab76 100644
--- a/activemodel/lib/active_model/serializers/json.rb
+++ b/activemodel/lib/active_model/serializers/json.rb
@@ -2,6 +2,7 @@ require 'active_support/json'
require 'active_support/core_ext/class/attribute'
module ActiveModel
+ # == Active Model JSON Serializer
module Serializers
module JSON
extend ActiveSupport::Concern
@@ -14,8 +15,8 @@ module ActiveModel
self.include_root_in_json = true
end
- # Returns a JSON string representing the model. Some configuration is
- # available through +options+.
+ # Returns a JSON string representing the model. Some configuration can be
+ # passed through +options+.
#
# The option <tt>ActiveModel::Base.include_root_in_json</tt> controls the
# top-level behavior of to_json. It is true by default. When it is <tt>true</tt>,
diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb
index 934af2b8a8..ed64434b8f 100644
--- a/activemodel/lib/active_model/serializers/xml.rb
+++ b/activemodel/lib/active_model/serializers/xml.rb
@@ -5,6 +5,7 @@ require 'active_support/core_ext/hash/conversions'
require 'active_support/core_ext/hash/slice'
module ActiveModel
+ # == Active Model XML Serializer
module Serializers
module Xml
extend ActiveSupport::Concern
@@ -131,6 +132,8 @@ module ActiveModel
end
end
+ # Returns XML representing the model. Configuration can be
+ # passed through +options+.
def to_xml(options = {}, &block)
Serializer.new(self, options).serialize(&block)
end
diff --git a/activemodel/lib/active_model/translation.rb b/activemodel/lib/active_model/translation.rb
index 2ab342ffac..3228cfed9a 100644
--- a/activemodel/lib/active_model/translation.rb
+++ b/activemodel/lib/active_model/translation.rb
@@ -1,9 +1,11 @@
require 'active_support/core_ext/hash/reverse_merge'
module ActiveModel
-
- # ActiveModel::Translation provides integration between your object and
- # the Rails internationalization (i18n) framework.
+
+ # == Active Model Translation
+ #
+ # Provides integration between your object and the Rails internationalization
+ # (i18n) framework.
#
# A minimal implementation could be:
#
@@ -26,14 +28,16 @@ module ActiveModel
:activemodel
end
- # When localizing a string, goes through the lookup returned by this method.
- # Used in ActiveModel::Name#human, ActiveModel::Errors#full_messages and
+ # When localizing a string, it goes through the lookup returned by this
+ # method, which is used in ActiveModel::Name#human,
+ # ActiveModel::Errors#full_messages and
# ActiveModel::Translation#human_attribute_name.
def lookup_ancestors
self.ancestors.select { |x| x.respond_to?(:model_name) }
end
- # Transforms attributes names into a more human format, such as "First name" instead of "first_name".
+ # Transforms attribute names into a more human format, such as "First name"
+ # instead of "first_name".
#
# Person.human_attribute_name("first_name") # => "First name"
#
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index d7e3544849..57487cf75a 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -5,7 +5,9 @@ require 'active_support/core_ext/hash/keys'
require 'active_model/errors'
module ActiveModel
-
+
+ # == Active Model Validations
+ #
# Provides a full validation framework to your objects.
#
# A minimal implementation could be:
@@ -38,7 +40,7 @@ module ActiveModel
#
# Note that ActiveModel::Validations automatically adds an +errors+ method
# to your instances initialized with a new ActiveModel::Errors object, so
- # there is no need for you to add this manually.
+ # there is no need for you to do this manually.
#
module Validations
extend ActiveSupport::Concern
@@ -71,14 +73,14 @@ module ActiveModel
# end
#
# Options:
- # * <tt>:on</tt> - Specifies when this validation is active (default is <tt>:save</tt>,
- # other options <tt>:create</tt>, <tt>:update</tt>).
+ # * <tt>:on</tt> - Specifies when this validation is active (default is
+ # <tt>:save</tt>, other options <tt>:create</tt>, <tt>:update</tt>).
# * <tt>:allow_nil</tt> - Skip validation if attribute is +nil+.
# * <tt>:allow_blank</tt> - Skip validation if attribute is blank.
- # * <tt>:if</tt> - Specifies a method, proc or string to call to determine if the validation should
- # occur (e.g. <tt>:if => :allow_validation</tt>, or
- # <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>). The
- # method, proc or string should return or evaluate to a true or false value.
+ # * <tt>:if</tt> - Specifies a method, proc or string to call to determine
+ # if the validation should occur (e.g. <tt>:if => :allow_validation</tt>,
+ # or <tt>:if => Proc.new { |user| user.signup_step > 2 }</tt>). The method,
+ # proc or string should return or evaluate to a true or false value.
# * <tt>:unless</tt> - Specifies a method, proc or string to call to determine if the validation should
# not occur (e.g. <tt>:unless => :skip_validation</tt>, or
# <tt>:unless => Proc.new { |user| user.signup_step <= 2 }</tt>). The
@@ -104,7 +106,7 @@ module ActiveModel
# end
# end
#
- # Or with a block which is passed the current record to be validated:
+ # Or with a block which is passed with the current record to be validated:
#
# class Comment
# include ActiveModel::Validations
@@ -127,7 +129,8 @@ module ActiveModel
set_callback(:validate, *args, &block)
end
- # List all validators that being used to validate the model using +validates_with+ method.
+ # List all validators that are being used to validate the model using
+ # +validates_with+ method.
def validators
_validators.values.flatten.uniq
end
@@ -155,9 +158,9 @@ module ActiveModel
@errors ||= Errors.new(self)
end
- # Runs all the specified validations and returns true if no errors were added otherwise false.
- # Context can optionally be supplied to define which callbacks to test against (the context is
- # defined on the validations using :on).
+ # Runs all the specified validations and returns true if no errors were added
+ # otherwise false. Context can optionally be supplied to define which callbacks
+ # to test against (the context is defined on the validations using :on).
def valid?(context = nil)
current_context, self.validation_context = validation_context, context
errors.clear
@@ -167,14 +170,17 @@ module ActiveModel
self.validation_context = current_context
end
- # Performs the opposite of <tt>valid?</tt>. Returns true if errors were added, false otherwise.
+ # Performs the opposite of <tt>valid?</tt>. Returns true if errors were added,
+ # false otherwise.
def invalid?(context = nil)
!valid?(context)
end
- # Hook method defining how an attribute value should be retieved. 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 e.g.
+ # Hook method defining how an attribute value should be retieved. 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:
+ #
# class MyClass
# include ActiveModel::Validations
#
diff --git a/activemodel/lib/active_model/validator.rb b/activemodel/lib/active_model/validator.rb
index 56179c1a6c..dd9e39843e 100644
--- a/activemodel/lib/active_model/validator.rb
+++ b/activemodel/lib/active_model/validator.rb
@@ -3,6 +3,9 @@ require "active_support/core_ext/module/anonymous"
require 'active_support/core_ext/object/blank'
module ActiveModel #:nodoc:
+
+ # == Active Model Validator
+ #
# A simple base class that can be used along with
# +ActiveModel::Validations::ClassMethods.validates_with+
#
@@ -127,7 +130,7 @@ module ActiveModel #:nodoc:
# in the options hash invoking the validate_each method passing in the
# record, attribute and value.
#
- # All ActiveModel validations are built on top of this Validator.
+ # All Active Model validations are built on top of this Validator.
class EachValidator < Validator
attr_reader :attributes
diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb
index 1f5217191c..f13c250ca4 100644
--- a/activerecord/lib/active_record/association_preload.rb
+++ b/activerecord/lib/active_record/association_preload.rb
@@ -6,7 +6,7 @@ module ActiveRecord
module AssociationPreload #:nodoc:
extend ActiveSupport::Concern
- # Implements the details of eager loading of ActiveRecord associations.
+ # Implements the details of eager loading of Active Record associations.
# Application developers should not use this module directly.
#
# ActiveRecord::Base is extended with this module. The source code in
@@ -18,7 +18,7 @@ module ActiveRecord
# The first one is by using table joins. This was only strategy available
# prior to Rails 2.1. Suppose that you have an Author model with columns
# 'name' and 'age', and a Book model with columns 'name' and 'sales'. Using
- # this strategy, ActiveRecord would try to retrieve all data for an author
+ # this strategy, Active Record would try to retrieve all data for an author
# and all of its books via a single query:
#
# SELECT * FROM authors
@@ -31,7 +31,7 @@ module ActiveRecord
# 'books' table is useful; the joined 'authors' data is just redundant, and
# processing this redundant data takes memory and CPU time. The problem
# quickly becomes worse and worse as the level of eager loading increases
- # (i.e. if ActiveRecord is to eager load the associations' associations as
+ # (i.e. if Active Record is to eager load the associations' associations as
# well).
#
# The second strategy is to use multiple database queries, one for each
@@ -45,7 +45,7 @@ module ActiveRecord
module ClassMethods
protected
- # Eager loads the named associations for the given ActiveRecord record(s).
+ # Eager loads the named associations for the given Active Record record(s).
#
# In this description, 'association name' shall refer to the name passed
# to an association creation method. For example, a model that specifies
@@ -80,7 +80,7 @@ module ActiveRecord
# { :author => :avatar }
# [ :books, { :author => :avatar } ]
#
- # +preload_options+ contains options that will be passed to ActiveRecord#find
+ # +preload_options+ contains options that will be passed to ActiveRecord::Base#find
# (which is called under the hood for preloading records). But it is passed
# only one level deep in the +associations+ argument, i.e. it's not passed
# to the child associations when +associations+ is a Hash.
@@ -166,7 +166,7 @@ module ActiveRecord
end
end
- # Given a collection of ActiveRecord objects, constructs a Hash which maps
+ # Given a collection of Active Record objects, constructs a Hash which maps
# the objects' IDs to the relevant objects. Returns a 2-tuple
# <tt>(id_to_record_map, ids)</tt> where +id_to_record_map+ is the Hash,
# and +ids+ is an Array of record IDs.
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index c1e16d08cb..9b59266bbc 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -711,7 +711,7 @@ module ActiveRecord
#
# The +traps+ association on +Dungeon+ and the the +dungeon+ association on +Trap+ are the inverse of each other and the
# inverse of the +dungeon+ association on +EvilWizard+ is the +evil_wizard+ association on +Dungeon+ (and vice-versa). By default,
- # +ActiveRecord+ doesn't do know anything about these inverse relationships and so no object loading optimisation is possible. For example:
+ # Active Record doesn't know anything about these inverse relationships and so no object loading optimisation is possible. For example:
#
# d = Dungeon.first
# t = d.traps.first
@@ -721,7 +721,7 @@ module ActiveRecord
#
# The +Dungeon+ instances +d+ and <tt>t.dungeon</tt> in the above example refer to the same object data from the database, but are
# actually different in-memory copies of that data. Specifying the <tt>:inverse_of</tt> option on associations lets you tell
- # +ActiveRecord+ about inverse relationships and it will optimise object loading. For example, if we changed our model definitions to:
+ # Active Record about inverse relationships and it will optimise object loading. For example, if we changed our model definitions to:
#
# class Dungeon < ActiveRecord::Base
# has_many :traps, :inverse_of => :dungeon
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
index 454d3e60e3..979ed52f4a 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -9,7 +9,7 @@ module ActiveRecord
end
module ConnectionAdapters
- # Connection pool base class for managing ActiveRecord database
+ # Connection pool base class for managing Active Record database
# connections.
#
# == Introduction
@@ -30,12 +30,12 @@ module ActiveRecord
# Connections can be obtained and used from a connection pool in several
# ways:
#
- # 1. Simply use ActiveRecord::Base.connection as with ActiveRecord 2.1 and
+ # 1. Simply use ActiveRecord::Base.connection as with Active Record 2.1 and
# earlier (pre-connection-pooling). Eventually, when you're done with
# the connection(s) and wish it to be returned to the pool, you call
# ActiveRecord::Base.clear_active_connections!. This will be the
- # default behavior for ActiveRecord when used in conjunction with
- # ActionPack's request handling cycle.
+ # default behavior for Active Record when used in conjunction with
+ # Action Pack's request handling cycle.
# 2. Manually check out a connection from the pool with
# ActiveRecord::Base.connection_pool.checkout. You are responsible for
# returning this connection to the pool when finished by calling
@@ -265,7 +265,7 @@ module ActiveRecord
end
# ConnectionHandler is a collection of ConnectionPool objects. It is used
- # for keeping separate connection pools for ActiveRecord models that connect
+ # for keeping separate connection pools for Active Record models that connect
# to different databases.
#
# For example, suppose that you have 5 models, with the following hierarchy:
@@ -285,7 +285,7 @@ module ActiveRecord
# is not the same as the one used by Book/ScaryBook/GoodBook.
#
# Normally there is only a single ConnectionHandler instance, accessible via
- # ActiveRecord::Base.connection_handler. ActiveRecord models use this to
+ # ActiveRecord::Base.connection_handler. Active Record models use this to
# determine that connection pool that they should use.
class ConnectionHandler
def initialize(pools = {})
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
index db17bb348a..23c42d670b 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
@@ -103,7 +103,7 @@ module ActiveRecord
connection_handler.retrieve_connection(self)
end
- # Returns true if +ActiveRecord+ is connected.
+ # Returns true if Active Record is connected.
def connected?
connection_handler.connected?(self)
end
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index fecd4d590e..4ee9fee4a9 100755
--- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -15,7 +15,7 @@ require 'active_record/connection_adapters/abstract/database_limits'
module ActiveRecord
module ConnectionAdapters # :nodoc:
- # ActiveRecord supports multiple database systems. AbstractAdapter and
+ # Active Record supports multiple database systems. AbstractAdapter and
# related classes form the abstraction layer which makes this possible.
# An AbstractAdapter represents a connection to a database, and provides an
# abstract interface for database-specific functionality such as establishing
@@ -59,7 +59,7 @@ module ActiveRecord
end
# Can this adapter determine the primary key for tables not attached
- # to an ActiveRecord class, such as join tables? Backend specific, as
+ # to an Active Record class, such as join tables? Backend specific, as
# the abstract adapter always returns +false+.
def supports_primary_key?
false
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 34aaff2b49..bb8850f134 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -224,7 +224,7 @@ module ActiveRecord
if @connection.respond_to?(:status)
@connection.status == PGconn::CONNECTION_OK
else
- # We're asking the driver, not ActiveRecord, so use @connection.query instead of #query
+ # We're asking the driver, not Active Record, so use @connection.query instead of #query
@connection.query 'SELECT 1'
true
end
@@ -258,7 +258,7 @@ module ActiveRecord
true
end
- # Does PostgreSQL support finding primary key on non-ActiveRecord tables?
+ # Does PostgreSQL support finding primary key on non-Active Record tables?
def supports_primary_key? #:nodoc:
true
end
@@ -925,7 +925,7 @@ module ActiveRecord
# Use standard-conforming strings if available so we don't have to do the E'...' dance.
set_standard_conforming_strings
- # If using ActiveRecord's time zone support configure the connection to return
+ # If using Active Record's time zone support configure the connection to return
# TIMESTAMP WITH ZONE types in UTC.
execute("SET time zone 'UTC'") if ActiveRecord::Base.default_timezone == :utc
end
diff --git a/activerecord/lib/active_record/locale/en.yml b/activerecord/lib/active_record/locale/en.yml
index 9d5cb54180..a0e94cbec1 100644
--- a/activerecord/lib/active_record/locale/en.yml
+++ b/activerecord/lib/active_record/locale/en.yml
@@ -4,7 +4,7 @@ en:
#created_at: "Created at"
#updated_at: "Updated at"
- # ActiveRecord models configuration
+ # Active Record models configuration
activerecord:
errors:
messages:
diff --git a/activerecord/test/cases/defaults_test.rb b/activerecord/test/cases/defaults_test.rb
index 39aafa1ec7..ef29422824 100644
--- a/activerecord/test/cases/defaults_test.rb
+++ b/activerecord/test/cases/defaults_test.rb
@@ -43,7 +43,7 @@ if current_adapter?(:MysqlAdapter)
class DefaultsTestWithoutTransactionalFixtures < ActiveRecord::TestCase
# ActiveRecord::Base#create! (and #save and other related methods) will
# open a new transaction. When in transactional fixtures mode, this will
- # cause ActiveRecord to create a new savepoint. However, since MySQL doesn't
+ # cause Active Record to create a new savepoint. However, since MySQL doesn't
# support DDL transactions, creating a table will result in any created
# savepoints to be automatically released. This in turn causes the savepoint
# release code in AbstractAdapter#transaction to fail.
diff --git a/activeresource/test/cases/base_test.rb b/activeresource/test/cases/base_test.rb
index 35c3f4c6ef..4d036d73cc 100644
--- a/activeresource/test/cases/base_test.rb
+++ b/activeresource/test/cases/base_test.rb
@@ -52,7 +52,7 @@ class BaseTest < Test::Unit::TestCase
:children => [{:name => 'Natacha'}]},
{:name => 'Milena',
:children => []}]}]}.to_xml(:root => 'customer')
- # - resource with yaml array of strings; for ActiveRecords using serialize :bar, Array
+ # - resource with yaml array of strings; for ARs using serialize :bar, Array
@marty = <<-eof.strip
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<person>
diff --git a/activeresource/test/cases/finder_test.rb b/activeresource/test/cases/finder_test.rb
index 535b6f4198..1f52868966 100644
--- a/activeresource/test/cases/finder_test.rb
+++ b/activeresource/test/cases/finder_test.rb
@@ -50,7 +50,7 @@ class FinderTest < Test::Unit::TestCase
:children => [{:name => 'Natacha'}]},
{:name => 'Milena',
:children => []}]}]}.to_xml(:root => 'customer')
- # - resource with yaml array of strings; for ActiveRecords using serialize :bar, Array
+ # - resource with yaml array of strings; for ARs using serialize :bar, Array
@marty = <<-eof.strip
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<person>
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 16fdfd04e9..3ff33eea72 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -445,11 +445,13 @@ module ActiveSupport
# Use skip_callback to skip any defined one.
#
# When creating or skipping callbacks, you can specify conditions that
- # are always the same for a given key. For instance, in ActionPack,
+ # are always the same for a given key. For instance, in Action Pack,
# we convert :only and :except conditions into per-key conditions.
#
# before_filter :authenticate, :except => "index"
+ #
# becomes
+ #
# dispatch_callback :before, :authenticate, :per_key => {:unless => proc {|c| c.action_name == "index"}}
#
# Per-Key conditions are evaluated only once per use of a given key.
@@ -510,48 +512,65 @@ module ActiveSupport
__define_runner(symbol)
end
- # Define callbacks types.
- #
- # ==== Example
+ # Defines callbacks types:
#
# define_callbacks :validate
#
- # ==== Options
+ # This macro accepts the following options:
#
# * <tt>:terminator</tt> - Indicates when a before filter is considered
# to be halted.
#
# define_callbacks :validate, :terminator => "result == false"
#
- # In the example above, if any before validate callbacks returns false,
- # other callbacks are not executed. Defaults to "false".
+ # In the example above, if any before validate callbacks returns +false+,
+ # other callbacks are not executed. Defaults to "false", meaning no value
+ # halts the chain.
#
# * <tt>:rescuable</tt> - By default, after filters are not executed if
- # the given block or an before_filter raises an error. Supply :rescuable => true
- # to change this behavior.
+ # the given block or a before filter raises an error. Set this option to
+ # true to change this behavior.
+ #
+ # * <tt>:scope</tt> - Indicates which methods should be executed when a class
+ # is given as callback. Defaults to <tt>[:kind]</tt>.
+ #
+ # class Audit
+ # def before(caller)
+ # puts 'Audit: before is called'
+ # end
#
- # * <tt>:scope</tt> - Show which methods should be executed when a class
- # is given as callback:
+ # def before_save(caller)
+ # puts 'Audit: before_save is called'
+ # end
+ # end
#
- # define_callbacks :filters, :scope => [ :kind ]
+ # class Account
+ # include ActiveSupport::Callbacks
#
- # When a class is given:
+ # define_callbacks :save
+ # set_callback :save, :before, Audit.new
#
- # before_filter MyFilter
+ # def save
+ # run_callbacks :save do
+ # puts 'save in main'
+ # end
+ # end
+ # end
#
- # It will call the type of the filter in the given class, which in this
- # case, is "before".
+ # In the above case whenever you save an account the method <tt>Audit#before</tt> will
+ # be called. On the other hand
#
- # If, for instance, you supply the given scope:
+ # define_callbacks :save, :scope => [:kind, :name]
#
- # define_callbacks :validate, :scope => [ :kind, :name ]
+ # would trigger <tt>Audit#before_save</tt> instead. That's constructed by calling
+ # <tt>"#{kind}_#{name}"</tt> on the given instance. In this case "kind" is "before" and
+ # "name" is "save".
#
- # It will call "#{kind}_#{name}" in the given class. So "before_validate"
- # will be called in the class below:
+ # A declaration like
#
- # before_validate MyValidation
+ # define_callbacks :save, :scope => [:name]
#
- # Defaults to :kind.
+ # would call <tt>Audit#save</tt>.
#
def define_callbacks(*callbacks)
config = callbacks.last.is_a?(Hash) ? callbacks.pop : {}
diff --git a/activesupport/lib/active_support/xml_mini/rexml.rb b/activesupport/lib/active_support/xml_mini/rexml.rb
index 863d66a91d..a58f22ee5d 100644
--- a/activesupport/lib/active_support/xml_mini/rexml.rb
+++ b/activesupport/lib/active_support/xml_mini/rexml.rb
@@ -11,7 +11,7 @@ module ActiveSupport
# Parse an XML Document string or IO into a simple hash
#
# Same as XmlSimple::xml_in but doesn't shoot itself in the foot,
- # and uses the defaults from ActiveSupport
+ # and uses the defaults from Active Support.
#
# data::
# XML Document string or IO to parse
diff --git a/ci/site_config.rb b/ci/site_config.rb
index ac7f658237..c08dac8e84 100644
--- a/ci/site_config.rb
+++ b/ci/site_config.rb
@@ -6,8 +6,8 @@
# EMAIL NOTIFICATION
# ------------------
-# CruiseControl.rb can notify you about build status via email. It uses ActionMailer component of Ruby on Rails
-# framework. Obviously, ActionMailer needs to know how to send out email messages.
+# CruiseControl.rb can notify you about build status via email. It uses the Action Mailer component of Ruby on Rails
+# framework. Obviously, Action Mailer needs to know how to send out email messages.
# If you have an SMTP server on your network, and it needs no authentication, write this in your site_config.rb:
#
ActionMailer::Base.smtp_settings = {
diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile
index ab72b48034..86655746e4 100644
--- a/railties/guides/source/configuring.textile
+++ b/railties/guides/source/configuring.textile
@@ -135,7 +135,7 @@ h4. Configuring Action Controller
* +config.action_controller.allow_concurrency+ should be set to +true+ to allow concurrent (threadsafe) action processing. Set to +false+ by default. You probably don't want to call this one directly, though, because a series of other adjustments need to be made for threadsafe mode to work properly. Instead, you should simply call +config.threadsafe!+ inside your +production.rb+ file, which makes all the necessary adjustments.
-WARNING: Threadsafe operation in incompatible with the normal workings of development mode Rails. In particular, automatic dependency loading and class reloading are automatically disabled when you call +config.threadsafe!+.
+WARNING: Threadsafe operation is incompatible with the normal workings of development mode Rails. In particular, automatic dependency loading and class reloading are automatically disabled when you call +config.threadsafe!+.
* +config.action_controller.param_parsers+ provides an array of handlers that can extract information from incoming HTTP requests and add it to the +params+ hash. By default, parsers for multipart forms, URL-encoded forms, XML, and JSON are active.
@@ -167,9 +167,9 @@ The caching code adds two additional settings:
The Active Record session store can also be configured:
-* +ActiveRecord::SessionStore::Session.table_name+ sets the name of the table uses to store sessions. Defaults to +sessions+.
+* +ActiveRecord::SessionStore::Session.table_name+ sets the name of the table used to store sessions. Defaults to +sessions+.
-* +ActiveRecord::SessionStore::Session.primary_key+ sets the name of the ID column uses in the sessions table. Defaults to +session_id+.
+* +ActiveRecord::SessionStore::Session.primary_key+ sets the name of the ID column used in the sessions table. Defaults to +session_id+.
* +ActiveRecord::SessionStore::Session.data_column_name+ sets the name of the column which stores marshaled session data. Defaults to +data+.
@@ -235,9 +235,9 @@ h4. Configuring Active Support
There are a few configuration options available in Active Support:
-* +config.active_support.escape_html_entities_in_json+ enables or disables the escaping of HTML entities in JSON serialization. Defaults to _true_.
+* +config.active_support.escape_html_entities_in_json+ enables or disables the escaping of HTML entities in JSON serialization. Defaults to +true+.
-* +config.active_support.use_standard_json_time_format+ enables or disables serializing dates to ISO 8601 format. Defaults to _false_.
+* +config.active_support.use_standard_json_time_format+ enables or disables serializing dates to ISO 8601 format. Defaults to +false+.
* +ActiveSupport::BufferedLogger.silencer+ is set to +false+ to disable the ability to silence logging in a block. The default is +true+.
@@ -247,7 +247,7 @@ There are a few configuration options available in Active Support:
h3. Using Initializers
-After it loads the framework plus any gems and plugins in your application, Rails turns to loading initializers. An initializer is any file of ruby code stored under +config/initializers+ in your application. You can use initializers to hold configuration settings that should be made after all of the frameworks and plugins are loaded.
+After loading the framework and any gems and plugins in your application, Rails turns to loading initializers. An initializer is any file of Ruby code stored under +config/initializers+ in your application. You can use initializers to hold configuration settings that should be made after all of the frameworks and plugins are loaded.
NOTE: You can use subfolders to organize your initializers if you like, because Rails will look into the whole file hierarchy from the +initializers+ folder on down.
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb
index 7d476574e1..ed66f493e6 100644
--- a/railties/lib/rails.rb
+++ b/railties/lib/rails.rb
@@ -67,7 +67,7 @@ module Rails
def backtrace_cleaner
@@backtrace_cleaner ||= begin
- # Relies on ActiveSupport, so we have to lazy load to postpone definition until AS has been loaded
+ # Relies on Active Support, so we have to lazy load to postpone definition until AS has been loaded
require 'rails/backtrace_cleaner'
Rails::BacktraceCleaner.new
end
diff --git a/railties/lib/rails/log_subscriber.rb b/railties/lib/rails/log_subscriber.rb
index 9a74fee745..a30701d4d5 100644
--- a/railties/lib/rails/log_subscriber.rb
+++ b/railties/lib/rails/log_subscriber.rb
@@ -6,7 +6,7 @@ module Rails
# on initialization with solely purpose of logging. The log subscriber dispatches
# notifications to a regirested object based on its given namespace.
#
- # An example would be ActiveRecord log subscriber responsible for logging queries:
+ # An example would be Active Record log subscriber responsible for logging queries:
#
# module ActiveRecord
# class Railtie
diff --git a/railties/lib/rails/log_subscriber/test_helper.rb b/railties/lib/rails/log_subscriber/test_helper.rb
index 02f5079462..9b7b0738cd 100644
--- a/railties/lib/rails/log_subscriber/test_helper.rb
+++ b/railties/lib/rails/log_subscriber/test_helper.rb
@@ -3,7 +3,7 @@ require 'rails/log_subscriber'
module Rails
class LogSubscriber
# Provides some helpers to deal with testing log subscribers by setting up
- # notifications. Take for instance ActiveRecord subscriber tests:
+ # notifications. Take for instance Active Record subscriber tests:
#
# class SyncLogSubscriberTest < ActiveSupport::TestCase
# include Rails::LogSubscriber::TestHelper
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb
index 1dba6e1538..ad776933f2 100644
--- a/railties/lib/rails/railtie.rb
+++ b/railties/lib/rails/railtie.rb
@@ -10,7 +10,7 @@ module Rails
# Every major component of Rails (Action Mailer, Action Controller,
# Action View, Active Record and Active Resource) are all Railties, so each of
# them is responsible to set their own initialization. This makes, for example,
- # Rails absent of any ActiveRecord hook, allowing any other ORM framework to hook in.
+ # Rails absent of any Active Record hook, allowing any other ORM framework to hook in.
#
# Developing a Rails extension does _not_ require any implementation of
# Railtie, but if you need to interact with the Rails framework during
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake
index 4bddf7600a..ecd513c2c8 100644
--- a/railties/lib/rails/test_unit/testing.rake
+++ b/railties/lib/rails/test_unit/testing.rake
@@ -58,7 +58,7 @@ def recent_tests(source_pattern, test_path, touched_since = 10.minutes.ago)
end
-# Recreated here from ActiveSupport because :uncommitted needs it before Rails is available
+# Recreated here from Active Support because :uncommitted needs it before Rails is available
module Kernel
def silence_stderr
old_stderr = STDERR.dup
diff --git a/railties/test/application/initializers/notifications_test.rb b/railties/test/application/initializers/notifications_test.rb
index 276950c78c..fc8548af1f 100644
--- a/railties/test/application/initializers/notifications_test.rb
+++ b/railties/test/application/initializers/notifications_test.rb
@@ -37,7 +37,7 @@ module ApplicationTests
ActiveRecord::Base.logger = logger = MockLogger.new
- # Mimic ActiveRecord notifications
+ # Mimic Active Record notifications
instrument "sql.active_record", :name => "SQL", :sql => "SHOW tables"
wait