aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2014-08-01 10:30:13 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2014-08-01 10:30:13 -0700
commit64d91122222c11ad3918cc8e2e3ebc4b0a03448a (patch)
tree0935257a8c61fd59e52cb1a25388ce709c006a3d /activesupport/lib
parent702ad710b57bef45b081ebf42e6fa70820fdd810 (diff)
downloadrails-64d91122222c11ad3918cc8e2e3ebc4b0a03448a.tar.gz
rails-64d91122222c11ad3918cc8e2e3ebc4b0a03448a.tar.bz2
rails-64d91122222c11ad3918cc8e2e3ebc4b0a03448a.zip
Rename Object#self to Object#itself to have parity with matz sanctioned method name for Ruby 2.2
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/object.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/object/itself.rb (renamed from activesupport/lib/active_support/core_ext/object/self.rb)4
2 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/object.rb b/activesupport/lib/active_support/core_ext/object.rb
index 2646342b2e..f1106cca9b 100644
--- a/activesupport/lib/active_support/core_ext/object.rb
+++ b/activesupport/lib/active_support/core_ext/object.rb
@@ -2,7 +2,7 @@ require 'active_support/core_ext/object/acts_like'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/duplicable'
require 'active_support/core_ext/object/deep_dup'
-require 'active_support/core_ext/object/self'
+require 'active_support/core_ext/object/itself'
require 'active_support/core_ext/object/try'
require 'active_support/core_ext/object/inclusion'
diff --git a/activesupport/lib/active_support/core_ext/object/self.rb b/activesupport/lib/active_support/core_ext/object/itself.rb
index 5c51bf56c9..df613c4e4f 100644
--- a/activesupport/lib/active_support/core_ext/object/self.rb
+++ b/activesupport/lib/active_support/core_ext/object/itself.rb
@@ -1,10 +1,10 @@
class Object
# Returns the object itself. Useful when dealing with a chaining scenario, like Active Record scopes:
#
- # Event.public_send(state.presence_in?([ :trashed, :drafted ]) ? :self).order(:created_at)
+ # Event.public_send(state.presence_in?([ :trashed, :drafted ]) || :itself).order(:created_at)
#
# @return Object
- def self
+ def itself
self
end
end \ No newline at end of file