aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2014-08-19 23:45:43 -0700
committerZachary Scott <e@zzak.io>2014-08-19 23:45:43 -0700
commit24a9bc4fc8d0885c64e27a62fb2703416c6ab95d (patch)
treeb408e982e66a348e4fb02a7960f42677aca29fa2 /activesupport
parent161382fd04e89011ff05e8749b4feefb96ca1de6 (diff)
downloadrails-24a9bc4fc8d0885c64e27a62fb2703416c6ab95d.tar.gz
rails-24a9bc4fc8d0885c64e27a62fb2703416c6ab95d.tar.bz2
rails-24a9bc4fc8d0885c64e27a62fb2703416c6ab95d.zip
Add documentation intro to example for `Object#itself`.
Also moved comment for removal above `unless()` to not confuse RDoc with the documentation for this method.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/object/itself.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/itself.rb b/activesupport/lib/active_support/core_ext/object/itself.rb
index adedc20169..d71cea6674 100644
--- a/activesupport/lib/active_support/core_ext/object/itself.rb
+++ b/activesupport/lib/active_support/core_ext/object/itself.rb
@@ -1,6 +1,9 @@
class Object
- unless respond_to?(:itself) # TODO: Remove this file when we drop support for Ruby < 2.2
- # Returns the object itself. Useful when dealing with a chaining scenario, like Active Record scopes:
+ # TODO: Remove this file when we drop support for Ruby < 2.2
+ unless respond_to?(:itself)
+ # Returns the object itself.
+ #
+ # Useful for chaining methods, such as Active Record scopes:
#
# Event.public_send(state.presence_in([ :trashed, :drafted ]) || :itself).order(:created_at)
#