aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Prefer find_by over dynamic finders in rdocSam Ruby2013-04-021-3/+3
|
* Remove useless number signTatsuro Baba2013-01-181-2/+2
| | | | I think that these signs are probably mistake.
* find_or_initialize_by is deprecated in AR 4Akira Matsuda2013-01-021-7/+0
|
* find_or_create_by is deprecated in AR 4Akira Matsuda2013-01-021-25/+0
|
* find_last_by is deprecated in AR 4Akira Matsuda2013-01-021-4/+3
|
* find_all_by is deprecated in AR 4Akira Matsuda2013-01-021-6/+3
|
* scoped_by is deprecated in AR 4Akira Matsuda2013-01-021-6/+0
|
* Added STI support to init and building associationsJason Rush2012-11-291-0/+1
| | | | | | | | Allows you to do BaseClass.new(:type => "SubClass") as well as parent.children.build(:type => "SubClass") or parent.build_child to initialize an STI subclass. Ensures that the class name is a valid class and that it is in the ancestors of the super class that the association is expecting.
* Remove observers and sweepersRafael Mendonça França2012-11-281-2/+0
| | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-171-19/+19
|\ | | | | | | | | Conflicts: actionpack/lib/action_dispatch/routing/redirection.rb
| * 1.9 hash syntax changesAvnerCohen2012-11-081-19/+19
| |
* | Remove duplicated ConnectionHandling extension in AR::BaseCarlos Antonio da Silva2012-11-111-1/+0
| | | | | | | | | | Thanks @toretore. https://github.com/rails/rails/commit/9e4c41c903e8e58721f2c41776a8c60ddba7a0a9#commitcomment-2134706
* | Remove not used indifferent_access requires from Base and FinderMethodsCarlos Antonio da Silva2012-11-071-1/+0
|/
* Remove ActiveRecord::ModelJon Leighton2012-10-261-3/+43
| | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
* Revert "Get rid of the ActiveRecord::Model::DeprecationProxy thing."Jeremy Kemper2012-10-201-2/+2
| | | | This reverts commit 83846838252397b3781eed165ca301e05db39293.
* Get rid of the ActiveRecord::Model::DeprecationProxy thing.Jon Leighton2012-10-191-2/+2
| | | | | | | | | | | | | | | | | I think it's going to be too much pain to try to transition the :active_record load hook from executing against Base to executing against Model. For example, after Model is included in Base, and modules included in Model will no longer get added to the ancestors of Base. So plugins which wish to be compatible with both Model and Base should use the :active_record_model load hook which executes *before* Base gets loaded. In general, ActiveRecord::Model is an advanced feature at the moment and probably most people will continue to inherit from ActiveRecord::Base for the time being.
* Make ActiveRecord::Model::DeprecationProxy work betterJon Leighton2012-08-031-1/+1
| | | | Closes #6600
* load active_support/deprecation in active_support/railsXavier Noria2012-08-021-1/+0
|
* load active_support/core_ext/module/delegation in active_support/railsXavier Noria2012-08-021-1/+0
|
* load active_support/core_ext/class/attribute in active_support/railsXavier Noria2012-08-021-1/+0
|
* load active_support/core_ext/object/blank in active_support/railsXavier Noria2012-08-021-1/+0
|
* more edits [ci skip]Vijay Dev2012-05-011-1/+1
|
* add ActiveRecord::RecordInvalid to exceptionsHrvoje Šimić2012-04-301-9/+10
| | | | sort the exception names alphabetically
* fix markup error [ci skip]Vijay Dev2012-04-081-1/+1
|
* Add documentation for find_or_create_by_{attribute}! method.Andrew White2012-03-121-0/+3
|
* deleted duplicated linejuan david pastas2012-01-051-1/+0
|
* No need to require psych since require yaml does that.Rafael Mendonça França2012-01-041-1/+0
|
* No need to use rescue block to require psychRafael Mendonça França2012-01-041-5/+1
|
* Support establishing connection on ActiveRecord::Model.Jon Leighton2011-12-281-1/+0
| | | | | This is the 'top level' connection, inherited by any models that include ActiveRecord::Model or inherit from ActiveRecord::Base.
* Support configuration on ActiveRecord::Model.Jon Leighton2011-12-281-1/+0
| | | | | | | | | | | | | | | The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present.
* Fix position of load hook so that Base has been defined and included Model ↵Jon Leighton2011-12-241-0/+3
| | | | before it runs
* Deal with global config better between AR::Base and AR::ModelJon Leighton2011-12-241-1/+0
|
* I herd you like modules.Jon Leighton2011-12-241-0/+2
|
* Start work towards making AR include-able.Jon Leighton2011-12-241-369/+1
|
* Remove 1.8 backportJon Leighton2011-12-221-9/+0
|
* Make read_attribute code path accessible at the class levelJon Leighton2011-12-221-6/+3
|
* AS::Concern is not really needed for AR::ExplainXavier Noria2011-12-161-1/+1
|
* Move DefaultScope and NamedScope under ScopingJon Leighton2011-12-151-2/+1
|
* Let AttributeMethods do its own including etcJon Leighton2011-12-151-17/+0
|
* Split out most of the AR::Base code into separate modules :cake:Jon Leighton2011-12-151-1578/+58
|
* Make with_scope public so we stop using send :bomb:José Valim2011-12-151-90/+91
|
* Allow nested attributes in associations to update values in it's owner ↵Andrew Kaspick2011-12-141-1/+11
| | | | object. Fixes a regression from 3.0.x
* Cache column defaults on model. ~30% on Model.new due to avoiding repeatedly ↵Jon Leighton2011-12-141-2/+2
| | | | fetching connection.
* Use `table_exists?` from the schema cache.Aaron Patterson2011-12-091-1/+1
|
* Remove NilClass whiners feature.José Valim2011-12-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Removing this feature causes boost in performance when using Ruby 1.9. Ruby 1.9 started to do implicit conversions using `to_ary` and `to_str` in some STDLIB methods (like Array#join). To do such implicit conversions, Ruby 1.9 always dispatches the method and rescues the NoMethodError exception in case one is raised. Therefore, since the whiners feature defined NilClass#method_missing, such implicit conversions for nil became much, much slower. In fact, just defining NilClass#method_missing (even without the whiners feature) already causes a massive slow down. Here is a snippet that shows such slow down: require "benchmark" Benchmark.realtime { 1_000.times { [nil,nil,nil].join } } class NilClass def method_missing(*args) raise NoMethodError end end Benchmark.realtime { 1_000.times { [nil,nil,nil].join } }
* Merge pull request #3851 from ebeigarts/fix_sequence_nameJon Leighton2011-12-041-2/+2
|\ | | | | Fix sequence name with abstract classes.
| * Fix sequence name with abstract classes.Edgars Beigarts2011-12-041-2/+2
| |
* | Merge branch 'explain'Xavier Noria2011-12-041-0/+1
|\ \ | |/ |/|
| * implements a much faster auto EXPLAIN, closes #3843 [José Valim & Xavier Noria]Xavier Noria2011-12-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit vastly reduces the impact of auto explain logging when enabled, while keeping a negligible cost when disabled. The first implementation was based on the idea of subscribing to "sql.active_record" when needed, and unsubscribing once done. This is the idea behind AR::Relation#explain. Subscribe, collect, unsubscribe. But with the current implementation of notifications unsubscribing is costly, because it wipes an internal cache and that puts a penalty on the next event. So we are switching to an approach where a long-running subscriber is listening. Instead of collecting the queries with a closure in a dedicated subscriber, now we setup a thread local. If the feature is disabled by setting the threshold to nil, the subscriber will call a method that does nothing. That's totally cheap.
* | Refactor readonly attributes conditionalCarlos Antonio da Silva2011-12-041-1/+2
|/