diff options
-rw-r--r-- | activerecord/lib/active_record/attributes.rb | 20 | ||||
-rw-r--r-- | activerecord/lib/active_record/type/value.rb | 6 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/remove_method.rb | 6 | ||||
-rw-r--r-- | guides/source/autoloading_and_reloading_constants.md | 5 | ||||
-rw-r--r-- | guides/source/configuring.md | 4 | ||||
-rw-r--r-- | guides/source/layouts_and_rendering.md | 5 | ||||
-rw-r--r-- | railties/lib/rails/application.rb | 6 |
7 files changed, 30 insertions, 22 deletions
diff --git a/activerecord/lib/active_record/attributes.rb b/activerecord/lib/active_record/attributes.rb index c8979a60d7..50339b6f69 100644 --- a/activerecord/lib/active_record/attributes.rb +++ b/activerecord/lib/active_record/attributes.rb @@ -28,15 +28,18 @@ module ActiveRecord # information about providing custom type objects. # # ==== Options + # # The following options are accepted: # # +default+ The default value to use when no value is provided. If this option # is not passed, the previous default value (if any) will be used. # Otherwise, the default will be +nil+. # - # +array+ (PG only) specifies that the type should be an array (see the examples below). + # +array+ (PG only) specifies that the type should be an array (see the + # examples below). # - # +range+ (PG only) specifies that the type should be a range (see the examples below). + # +range+ (PG only) specifies that the type should be a range (see the + # examples below). # # ==== Examples # @@ -101,12 +104,11 @@ module ActiveRecord # ==== Creating Custom Types # # Users may also define their own custom types, as long as they respond - # to the methods defined on the value type. The method - # +deserialize+ or +cast+ will be called on - # your type object, with raw input from the database or from your - # controllers. See ActiveRecord::Type::Value for the expected API. It is - # recommended that your type objects inherit from an existing type, or - # from ActiveRecord::Type::Value + # to the methods defined on the value type. The method +deserialize+ or + # +cast+ will be called on your type object, with raw input from the + # database or from your controllers. See ActiveRecord::Type::Value for the + # expected API. It is recommended that your type objects inherit from an + # existing type, or from ActiveRecord::Type::Value # # class MoneyType < ActiveRecord::Type::Integer # def cast(value) @@ -150,7 +152,7 @@ module ActiveRecord # end # # # value will be the result of +deserialize+ or - # # +cast+. Assumed to be in instance of +Money+ in + # # +cast+. Assumed to be an instance of +Money+ in # # this case. # def serialize(value) # value_in_bitcoins = @currency_converter.convert_to_bitcoins(value) diff --git a/activerecord/lib/active_record/type/value.rb b/activerecord/lib/active_record/type/value.rb index fc3ef5e83b..6b9d147ecc 100644 --- a/activerecord/lib/active_record/type/value.rb +++ b/activerecord/lib/active_record/type/value.rb @@ -12,7 +12,7 @@ module ActiveRecord def type # :nodoc: end - # Convert a value from database input to the appropriate ruby type. The + # Converts a value from database input to the appropriate ruby type. The # return value of this method will be returned from # ActiveRecord::AttributeMethods::Read#read_attribute. The default # implementation just calls Value#cast. @@ -36,7 +36,7 @@ module ActiveRecord cast_value(value) unless value.nil? end - # Cast a value from the ruby type to a type that the database knows how + # Casts a value from the ruby type to a type that the database knows how # to understand. The returned value from this method should be a # +String+, +Numeric+, +Date+, +Time+, +Symbol+, +true+, +false+, or # +nil+. @@ -44,7 +44,7 @@ module ActiveRecord value end - # Type cast a value for schema dumping. This method is private, as we are + # Type casts a value for schema dumping. This method is private, as we are # hoping to remove it entirely. def type_cast_for_schema(value) # :nodoc: value.inspect diff --git a/activesupport/lib/active_support/core_ext/module/remove_method.rb b/activesupport/lib/active_support/core_ext/module/remove_method.rb index 8a2569a7d0..52632d2c6b 100644 --- a/activesupport/lib/active_support/core_ext/module/remove_method.rb +++ b/activesupport/lib/active_support/core_ext/module/remove_method.rb @@ -1,13 +1,13 @@ class Module - # Remove the named method, if it exists. + # Removes the named method, if it exists. def remove_possible_method(method) if method_defined?(method) || private_method_defined?(method) undef_method(method) end end - # Replace the existing method definition, if there is one, with the contents - # of the block. + # Replaces the existing method definition, if there is one, with the passed + # block as its body. def redefine_method(method, &block) remove_possible_method(method) define_method(method, &block) diff --git a/guides/source/autoloading_and_reloading_constants.md b/guides/source/autoloading_and_reloading_constants.md index 9e78eebf82..c6149abcba 100644 --- a/guides/source/autoloading_and_reloading_constants.md +++ b/guides/source/autoloading_and_reloading_constants.md @@ -465,7 +465,10 @@ by adding this to `config/application.rb`: ```ruby config.autoload_paths << "#{Rails.root}/lib" ``` -`config.autoload_paths` is accessible from environment-specific configuration files, but any changes made to it outside `config/application.rb` don't have an effect. + +`config.autoload_paths` is accessible from environment-specific configuration +files, but any changes made to it outside `config/application.rb` don't have any +effect. The value of `autoload_paths` can be inspected. In a just generated application it is (edited): diff --git a/guides/source/configuring.md b/guides/source/configuring.md index e0b09be782..4ebd634cd6 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -110,7 +110,9 @@ numbers. New applications filter out passwords by adding the following `config.f * `config.log_formatter` defines the formatter of the Rails logger. This option defaults to an instance of `ActiveSupport::Logger::SimpleFormatter` for all modes except production, where it defaults to `Logger::Formatter`. -* `config.log_level` defines the verbosity of the Rails logger. This option defaults to `:debug` for all environments. The available log levels are: :debug, :info, :warn, :error, :fatal, and :unknown. +* `config.log_level` defines the verbosity of the Rails logger. This option +defaults to `:debug` for all environments. The available log levels are: `:debug`, +`:info`, `:warn`, `:error`, `:fatal`, and `:unknown`. * `config.log_tags` accepts a list of methods that the `request` object responds to. This makes it easy to tag log lines with debug information like subdomain and request id - both very helpful in debugging multi-user production applications. diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md index 54db23bb32..c57fa358d6 100644 --- a/guides/source/layouts_and_rendering.md +++ b/guides/source/layouts_and_rendering.md @@ -428,12 +428,13 @@ Rails understands both numeric status codes and the corresponding symbols shown | | 510 | :not_extended | | | 511 | :network_authentication_required | -NOTE: If you try to render content along with a non-content status code +NOTE: If you try to render content along with a non-content status code (100-199, 204, 205 or 304), it will be dropped from the response. ##### The `:formats` Option -Rails uses the format specified in request (or `:html` by default). You can change this adding the `:formats` option with a symbol or an array: +Rails uses the format specified in the request (or `:html` by default). You can +change this passing the `:formats` option with a symbol or an array: ```ruby render formats: :xml diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index b11815e013..ff6c905f3e 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -427,9 +427,9 @@ module Rails # Return an array of railties respecting the order they're loaded # and the order specified by the +railties_order+ config. # - # While when running initializers we need engines in reverse - # order here when copying migrations from railties we need them in the same - # order as given by +railties_order+. + # While running initializers we need engines in reverse order here when + # copying migrations from railties ; we need them in the order given by + # +railties_order+. def migration_railties # :nodoc: ordered_railties.flatten - [self] end |