aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Timestamp values should be present on callbacksRafael Mendonça França2014-06-091-1/+1
| | | | | | | This reverts commit dd3ea17191e316aeebddaa7b176f6cfeee7a6365 and add a regression test. Fixes #15418
* Merge pull request #15558 from sgrif/sg-rename-propertyRafael Mendonça França2014-06-071-2/+2
|\ | | | | | | | | | | | | | | Rename `property` to `attribute` Conflicts: activerecord/lib/active_record/attribute_methods/serialization.rb activerecord/lib/active_record/base.rb
| * Rename `property` to `attribute`Sean Griffin2014-06-071-2/+2
| | | | | | | | For consistency with https://github.com/rails/rails/pull/15557
* | Don't query the database schema when calling `serialize`Sean Griffin2014-06-071-0/+2
|/ | | | | | We need to decorate the types lazily. This is extracted to a separate API, as there are other refactorings that will be able to make use of it, and to allow unit testing the finer points more granularly.
* Add a public API to allow users to specify column typesSean Griffin2014-05-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | As a result of all of the refactoring that's been done, it's now possible for us to define a public API to allow users to specify behavior. This is an initial implementation so that I can work off of it in smaller pieces for additional features/refactorings. The current behavior will continue to stay the same, though I'd like to refactor towards the automatic schema detection being built off of this API, and add the ability to opt out of automatic schema detection. Use cases: - We can deprecate a lot of the edge cases around types, now that there is an alternate path for users who wish to maintain the same behavior. - I intend to refactor serialized columns to be built on top of this API. - Gem and library maintainers are able to interact with `ActiveRecord` at a slightly lower level in a more stable way. - Interesting ability to reverse the work flow of adding to the schema. Model can become the single source of truth for the structure. We can compare that to what the database says the schema is, diff them, and generate a migration.
* `ActiveRecord::Base.no_touching` no longer triggers callbacks or start empty ↵Lucas Mazza2014-04-231-1/+1
| | | | | | transactions. Closes #14841.
* Merge pull request #14469 from tiegz/timestamp_inheritance_fixRafael Mendonça França2014-03-271-1/+1
| | | | Swap Timestamp/Callbacks order in ActiveRecord::Base
* put core at the beginning so other classes can modify the behaviorKeenan Brock2014-01-221-1/+1
|
* Remove deprecated cattr_* requiresGenadi Samokovarov2013-12-031-1/+1
|
* add #no_touching on ActiveRecord modelsDamien Mathieu2013-11-131-0/+1
|
* Added ActiveRecord::Base#enum for declaring enum attributes where the values ↵David Heinemeier Hansson2013-11-021-0/+1
| | | | map to integers in the database, but can be queried by name
* move the cache to the AR models and populate it on inheritedAaron Patterson2013-08-301-0/+2
|
* 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
|