From cc4c6d405df8d4339112b44670dcce1b52e93f42 Mon Sep 17 00:00:00 2001 From: Steven Harman Date: Fri, 14 Mar 2014 12:09:26 -0400 Subject: Fix misspelling in references docs --- activerecord/lib/active_record/relation/query_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/relation/query_methods.rb') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 8c005a7222..3a5b3116eb 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -168,7 +168,7 @@ module ActiveRecord # Use to indicate that the given +table_names+ are referenced by an SQL string, # and should therefore be JOINed in any query rather than loaded separately. - # This method only works in conjuction with +includes+. + # This method only works in conjunction with +includes+. # See #includes for more details. # # User.includes(:posts).where("posts.name = 'foo'") -- cgit v1.2.3 From 6c821073f3eb0cb4acec8ad98fc54a25fd5fe6ce Mon Sep 17 00:00:00 2001 From: Earl St Sauver Date: Mon, 17 Mar 2014 11:28:57 -0700 Subject: Update documentation on group method to indicate it takes an array The group method also takes an array, however this isn't immediately clear by reading the source since it delegates this method. If you trace it back to the AREL building you can see that it does support an array. Shoutout to @betovelandia for pointing this out. --- activerecord/lib/active_record/relation/query_methods.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record/relation/query_methods.rb') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 3a5b3116eb..eff10d3575 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -261,6 +261,10 @@ module ActiveRecord # # User.group('name AS grouped_name, age') # => [#, #, #] + # + # Passing in an array of attributes to group by is also supported. + # User.select([:id, :first_name]).group(:id, :first_name).first(3) + # => [#, #, #] def group(*args) check_if_method_has_arguments!(:group, args) spawn.group!(*args) -- cgit v1.2.3