aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-12/+12
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-12/+12
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-12/+12
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Revert "Adds `not_in?` onto Object"David Heinemeier Hansson2016-07-291-1/+0
|
* Adds `not_in?` onto ObjectJon McCartie2016-07-211-0/+1
|
* Removed Object#itself as it's implemented in ruby 2.2Cristian Bica2014-12-291-1/+0
|
* Rename Object#self to Object#itself to have parity with matz sanctioned ↵David Heinemeier Hansson2014-08-011-1/+1
| | | | method name for Ruby 2.2
* Added Object#self which returns the object itselfDavid Heinemeier Hansson2014-08-011-0/+1
|
* Revert "remove unnecssary require of `to_param`, as `to_query` is already ↵Rafael Mendonça França2014-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | require `to_param`" Revert "No need to require to_param, it is already required in to_query.rb" This reverts commits ccdd97662e1fb00c23c90d59f65c091904959561 and d697ee14264a90a39cdbe87857656d8b314ac9b7. Reason by @jeremy: These requires are not for implementation dependency. They ensure that requiring array conversions provides to_query, to_param, and other array conversion behaviors. The fact that to_query is implemented in terms of to_param is just a coincidence. If to_query removed its to_param require, then someone requiring array conversions would no longer have to_param available. This change removes these intentional dependencies on to_param in favor of implementation side effects—an undesirable move that's susceptible to regression.
* remove unnecssary require of `to_param`, as `to_query` is already require ↵Kuldeep Aggarwal2014-06-121-1/+0
| | | | `to_param`
* Moved all JSON core extensions into core_ext/object/jsonGodfrey Chan2013-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TL;DR The primary driver is to remove autoload surprise. This is related to #12106. (The root cause for that ticket is that json/add defines Regexp#to_json among others, but here I'll reproduce the problem without json/add.) Before: >> require 'active_support/core_ext/to_json' => true >> //.as_json NoMethodError: undefined method `as_json' for //:Regexp from (irb):3 from /Users/godfrey/.rvm/rubies/ruby-2.0.0-p195/bin/irb:16:in `<main>' >> //.to_json => "\"(?-mix:)\"" >> //.as_json => "(?-mix:)" After: >> require 'active_support/core_ext/to_json' => true >> //.as_json => "(?-mix:)" This is because ActiveSupport::JSON is autoloaded the first time Object#to_json is called, which causes additional core extentions (previously defined in active_support/json/encoding.rb) to be loaded. When someone require 'active_support/core_ext', the expectation is that it would add certain methods to the core classes NOW. The previous behaviour causes additional methods to be loaded the first time you call `to_json`, which could cause nasty surprises and other unplesant side-effects. This change moves all core extensions in to core_ext/json. AS::JSON is still autoloaded on first #to_json call, but since it nolonger include the core extensions, it should address the aforementioned bug. *Requiring core_ext/object/to_json now causes a deprecation warnning*
* Revert "remove unnecessary object/conversions file"Xavier Noria2012-10-161-2/+5
| | | | | | | This file is used at least by Active Merchant, its existence is maybe not necessary but no big deal either. This reverts commit ae9b3d7cecd77b9ace38671b183e1a360bf632b6.
* remove unnecessary object/conversions fileNihad Abbasov2012-10-021-5/+2
|
* Nice logic for deep_dup in railsAlexey Gaziev2012-05-061-0/+1
|
* Revert all the stuff to do with disallowing non-public methods for ↵Jon Leighton2011-08-251-1/+0
| | | | Module#delegate
* Backport Object#public_send to 1.8 so that we can implement Module#delegate ↵Jon Leighton2011-08-151-0/+1
| | | | such that non-public methods raise
* Cant use inclusion in commands/application.rb as the frameworks havent all ↵David Heinemeier Hansson2011-04-111-0/+1
| | | | been required yet
* Object#returning has gone, it's already deprecated on 3-0-stableSantiago Pastorino2010-08-151-1/+0
|
* Bring returning back to ease migration.José Valim2010-08-021-0/+1
|
* Object#returning removedSantiago Pastorino2010-07-251-2/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Define a convention for descendants and subclasses.José Valim2010-07-051-1/+0
| | | | | | The former should be symmetric with ancestors and include all children. However, it should not include self since ancestors + descendants should not have duplicated. The latter is symmetric to superclass in the sense it only includes direct children. By adopting a convention, we expect to have less conflict with other frameworks, as Datamapper. For this moment, to ensure ActiveModel::Validations can be used with Datamapper, we should always call ActiveSupport::DescendantsTracker.descendants(self) internally instead of self.descendants avoiding conflicts.
* AS json refactor, move to_json implementation to core_ext and a cleanup a ↵Santiago Pastorino2010-07-011-0/+1
| | | | bit the code
* moves Object#singleton_class to Kernel#singleton_class to match Ruby also ↵Xavier Noria2010-04-051-1/+0
| | | | there, same for #class_eval to simplify, and adds coverage for class_eval
* metaclass deprecated in 2.3.6Jeremy Kemper2010-02-251-1/+0
|
* Use Object#singleton_class instead of #metaclass. Prefer Ruby's choice.Jeremy Kemper2010-02-251-0/+1
|
* adds a few missing requires in AS object.rb and module.rbXavier Noria2010-02-141-0/+5
| | | | Signed-off-by: Yehuda Katz <yehudakatz@YK.local>
* Reinstate object/extending require too for Object.subclasses_ofJeremy Kemper2010-02-091-0/+1
|
* removes now void extending.rbXavier Noria2010-01-261-1/+0
|
* Fix dependencies revealed by testing in isolationJeremy Kemper2009-04-221-0/+1
|
* try is an object extensionJeremy Kemper2009-03-211-0/+1
|
* blank? and duplicable? are Object extensionsJeremy Kemper2009-03-211-0/+3
|
* Added Object#metaclassJoshua Peek2008-07-151-0/+1
|
* Move #to_query methods where they ought to belong. Closes #10395 [Chu Yeow]Jeremy Kemper2007-12-091-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8343 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat, consistent load pathsJeremy Kemper2007-10-021-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Object#copy_instance_variables_from Ruby 1.9 compatJeremy Kemper2007-09-271-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7654 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added reusable reloading support through the inclusion of the Relodable ↵David Heinemeier Hansson2006-01-291-0/+2
module that all subclasses of ActiveRecord::Base, ActiveRecord::Observer, ActiveController::Base, and ActionMailer::Base automatically gets [DHH]. Added auto-loading support for classes in modules, so Conductor::Migration will look for conductor/migration.rb and Conductor::Database::Settings will look for conductor/database/settings.rb [Nicholas Seckar]. Refactored extensions to module, class, and object in active support [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3493 5ecf4fe2-1ee6-0310-87b1-e25e094e27de