diff options
author | Cristian Bica <cristian.bica@gmail.com> | 2014-12-29 23:04:54 +0200 |
---|---|---|
committer | Cristian Bica <cristian.bica@gmail.com> | 2014-12-29 23:04:54 +0200 |
commit | 7217391fc70da16f309c71346310d2c08b52088f (patch) | |
tree | cd110f7f62e1ea2ec5af295f577758ff9631387e /activesupport | |
parent | 4be29e5b5dcd385e75b1a7481b38ad131ee78729 (diff) | |
download | rails-7217391fc70da16f309c71346310d2c08b52088f.tar.gz rails-7217391fc70da16f309c71346310d2c08b52088f.tar.bz2 rails-7217391fc70da16f309c71346310d2c08b52088f.zip |
Removed Object#itself as it's implemented in ruby 2.2
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object.rb | 1 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/itself.rb | 15 | ||||
-rw-r--r-- | activesupport/test/core_ext/object/itself_test.rb | 9 |
3 files changed, 0 insertions, 25 deletions
diff --git a/activesupport/lib/active_support/core_ext/object.rb b/activesupport/lib/active_support/core_ext/object.rb index f1106cca9b..f4f9152d6a 100644 --- a/activesupport/lib/active_support/core_ext/object.rb +++ b/activesupport/lib/active_support/core_ext/object.rb @@ -2,7 +2,6 @@ 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/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/itself.rb b/activesupport/lib/active_support/core_ext/object/itself.rb deleted file mode 100644 index d71cea6674..0000000000 --- a/activesupport/lib/active_support/core_ext/object/itself.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Object - # 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) - # - # @return Object - def itself - self - end - end -end diff --git a/activesupport/test/core_ext/object/itself_test.rb b/activesupport/test/core_ext/object/itself_test.rb deleted file mode 100644 index 65db0ddf40..0000000000 --- a/activesupport/test/core_ext/object/itself_test.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'abstract_unit' -require 'active_support/core_ext/object' - -class Object::ItselfTest < ActiveSupport::TestCase - test 'itself returns self' do - object = 'fun' - assert_equal object, object.itself - end -end |