aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2015-03-05 14:17:01 +0100
committerRobin Dupret <robin.dupret@gmail.com>2015-03-05 14:18:09 +0100
commitd969405acd98a6e6b39391e45fc3803fd3f26d32 (patch)
tree48da629602a9797863a2afaceaba731ae069f643 /activerecord
parent95cfeb968d189d5cd7f8ebcf53edfa3e2cd5f335 (diff)
downloadrails-d969405acd98a6e6b39391e45fc3803fd3f26d32.tar.gz
rails-d969405acd98a6e6b39391e45fc3803fd3f26d32.tar.bz2
rails-d969405acd98a6e6b39391e45fc3803fd3f26d32.zip
Some documentation edits [ci skip]
* Fix a few typos * Wrap some lines around 80 chars * Rephrase some statements
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attributes.rb20
-rw-r--r--activerecord/lib/active_record/type/value.rb6
2 files changed, 14 insertions, 12 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