From 49ff20d9b164693ed7fee880b69cc14b141678b3 Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Sun, 1 Dec 2013 03:19:56 -0500 Subject: Use genderless pronouns in API docs --- activerecord/lib/active_record/validations/uniqueness.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/validations') diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index e2b132ca81..bdb42c3724 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -204,7 +204,7 @@ module ActiveRecord # exception. You can either choose to let this error propagate (which # will result in the default Rails exception page being shown), or you # can catch it and restart the transaction (e.g. by telling the user - # that the title already exists, and asking him to re-enter the title). + # that the title already exists, and asking them to re-enter the title). # This technique is also known as # {optimistic concurrency control}[http://en.wikipedia.org/wiki/Optimistic_concurrency_control]. # -- cgit v1.2.3 From 5827824a6fdc210165cec15f1aa65879493d0d7a Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Mon, 2 Dec 2013 00:34:52 -0500 Subject: Cleanups in API docs: his => their --- activerecord/lib/active_record/validations/uniqueness.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/validations') diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb index bdb42c3724..7ebe9dfec0 100644 --- a/activerecord/lib/active_record/validations/uniqueness.rb +++ b/activerecord/lib/active_record/validations/uniqueness.rb @@ -174,11 +174,11 @@ module ActiveRecord # WHERE title = 'My Post' | # | # | # User 2 does the same thing and also - # | # infers that his title is unique. + # | # infers that their title is unique. # | SELECT * FROM comments # | WHERE title = 'My Post' # | - # # User 1 inserts his comment. | + # # User 1 inserts their comment. | # INSERT INTO comments | # (title, content) VALUES | # ('My Post', 'hi!') | -- cgit v1.2.3 From 8ea00ed91a89997098edc9d83b8ecb26ed72f8fc Mon Sep 17 00:00:00 2001 From: gmarik Date: Tue, 31 Dec 2013 11:51:33 -0600 Subject: Use `Array#wrap` instead `Array()` - since `Array()` calls `to_ary` or `to_a` on a subject - the intent is to 'wrap' subject into an array --- activerecord/lib/active_record/validations/presence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/validations') diff --git a/activerecord/lib/active_record/validations/presence.rb b/activerecord/lib/active_record/validations/presence.rb index 6b14c39686..9a19483da3 100644 --- a/activerecord/lib/active_record/validations/presence.rb +++ b/activerecord/lib/active_record/validations/presence.rb @@ -5,7 +5,7 @@ module ActiveRecord super attributes.each do |attribute| next unless record.class.reflect_on_association(attribute) - associated_records = Array(record.send(attribute)) + associated_records = Array.wrap(record.send(attribute)) # Superclass validates presence. Ensure present records aren't about to be destroyed. if associated_records.present? && associated_records.all? { |r| r.marked_for_destruction? } -- cgit v1.2.3