From e09129c94c382650987d1005f3e2741b60bfa0d6 Mon Sep 17 00:00:00 2001 From: Robin Dupret Date: Tue, 23 Jun 2015 17:55:37 +0200 Subject: [PATCH] A few documentation fixes [ci skip] --- actionview/lib/action_view/helpers/date_helper.rb | 12 ++++++------ activemodel/lib/active_model/validations/length.rb | 2 +- activerecord/lib/active_record/validations/length.rb | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/actionview/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb index 0633213d5e..9c8edc69a9 100644 --- a/actionview/lib/action_view/helpers/date_helper.rb +++ b/actionview/lib/action_view/helpers/date_helper.rb @@ -69,8 +69,8 @@ module ActionView # distance_of_time_in_words(to_time, from_time, include_seconds: true) # => about 6 years # distance_of_time_in_words(Time.now, Time.now) # => less than a minute # - # With the scope you can define a custom scope for Rails lookup - # the translation. + # With the scope option, you can define a custom scope for Rails + # to lookup the translation. # # For example you can define the following in your locale (e.g. en.yml). # @@ -78,8 +78,8 @@ module ActionView # distance_in_words: # short: # about_x_hours: - # one: 1 hr - # other: '%{count} hr' + # one: 'an hour' + # other: '%{count} hours' # # See https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml # for more examples. @@ -87,8 +87,8 @@ module ActionView # Which will then result in the following: # # from_time = Time.now - # distance_of_time_in_words(from_time, from_time + 50.minutes, scope: 'datetime.distance_in_words.short') # => 1 hr - # distance_of_time_in_words(from_time, from_time + 3.hours, scope: 'datetime.distance_in_words.short') # => 3 hr + # distance_of_time_in_words(from_time, from_time + 50.minutes, scope: 'datetime.distance_in_words.short') # => "an hour" + # distance_of_time_in_words(from_time, from_time + 3.hours, scope: 'datetime.distance_in_words.short') # => "3 hours" def distance_of_time_in_words(from_time, to_time = 0, options = {}) options = { scope: :'datetime.distance_in_words' diff --git a/activemodel/lib/active_model/validations/length.rb b/activemodel/lib/active_model/validations/length.rb index 2ea740b56b..fb33342d30 100644 --- a/activemodel/lib/active_model/validations/length.rb +++ b/activemodel/lib/active_model/validations/length.rb @@ -98,7 +98,7 @@ module ActiveModel module HelperMethods - # Validates that the specified attribute matches the length restrictions + # Validates that the specified attributes match the length restrictions # supplied. Only one option can be used at a time: # # class Person < ActiveRecord::Base diff --git a/activerecord/lib/active_record/validations/length.rb b/activerecord/lib/active_record/validations/length.rb index ebb1034da7..69e048eef1 100644 --- a/activerecord/lib/active_record/validations/length.rb +++ b/activerecord/lib/active_record/validations/length.rb @@ -22,7 +22,7 @@ module ActiveRecord end module ClassMethods - # Validates that the specified attributes matches the length restrictions supplied. + # Validates that the specified attributes match the length restrictions supplied. # If the attribute is an association, records that are marked for destruction are not counted. # # See ActiveModel::Validations::HelperMethods.validates_length_of for more information.