diff options
author | Xavier Noria <fxn@hashref.com> | 2016-09-14 11:36:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-14 11:36:12 +0200 |
commit | 0fe76197d2622674e1796a9a000995a7a1f6622b (patch) | |
tree | ad2e1380ede0a1789c7c1a7bffb1f43b465c4105 /activerecord/lib/active_record/relation | |
parent | 92703a9ea5d8b96f30e0b706b801c9185ef14f0e (diff) | |
parent | 3464cd5c288323ca115a4929d1e6b435c4afc8d4 (diff) | |
download | rails-0fe76197d2622674e1796a9a000995a7a1f6622b.tar.gz rails-0fe76197d2622674e1796a9a000995a7a1f6622b.tar.bz2 rails-0fe76197d2622674e1796a9a000995a7a1f6622b.zip |
Merge pull request #26489 from kamipo/fix_broken_comments_indentation
Fix broken comments indentation caused by rubocop auto-correct [ci skip]
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 14 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 32 |
2 files changed, 23 insertions, 23 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index a796e35261..09ca30e434 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -325,13 +325,13 @@ module ActiveRecord end] end - # Converts the given keys to the value that the database adapter returns as - # a usable column name: - # - # column_alias_for("users.id") # => "users_id" - # column_alias_for("sum(id)") # => "sum_id" - # column_alias_for("count(distinct users.id)") # => "count_distinct_users_id" - # column_alias_for("count(*)") # => "count_all" + # Converts the given keys to the value that the database adapter returns as + # a usable column name: + # + # column_alias_for("users.id") # => "users_id" + # column_alias_for("sum(id)") # => "sum_id" + # column_alias_for("count(distinct users.id)") # => "count_distinct_users_id" + # column_alias_for("count(*)") # => "count_all" def column_alias_for(keys) if keys.respond_to? :name keys = "#{keys.relation.name}.#{keys.name}" diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 78570140e5..9fbbe32e7f 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -1150,22 +1150,22 @@ module ActiveRecord end.flatten! end - # Checks to make sure that the arguments are not blank. Note that if some - # blank-like object were initially passed into the query method, then this - # method will not raise an error. - # - # Example: - # - # Post.references() # raises an error - # Post.references([]) # does not raise an error - # - # This particular method should be called with a method_name and the args - # passed into that method as an input. For example: - # - # def references(*args) - # check_if_method_has_arguments!("references", args) - # ... - # end + # Checks to make sure that the arguments are not blank. Note that if some + # blank-like object were initially passed into the query method, then this + # method will not raise an error. + # + # Example: + # + # Post.references() # raises an error + # Post.references([]) # does not raise an error + # + # This particular method should be called with a method_name and the args + # passed into that method as an input. For example: + # + # def references(*args) + # check_if_method_has_arguments!("references", args) + # ... + # end def check_if_method_has_arguments!(method_name, args) if args.blank? raise ArgumentError, "The method .#{method_name}() must contain arguments." |