aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/timestamp.rb
Commit message (Collapse)AuthorAgeFilesLines
* remove blank lines in the start of the ActiveRecord filesPonomarev Nikolay2014-07-291-1/+0
|
* Refactor determination of max updated timestampSean Griffin2014-06-091-3/+5
| | | | `[].max # => nil`
* [Active Record] Renamed private methods create_record and update_recordPrathamesh Sonpatki2014-02-201-2/+2
| | | | | | This is to ensure that they are not accidentally called by the app code. They are renamed to _create_record and _update_record respectively. Closes #11645
* Move changed_attributes into dirty.rbKeenan Brock2014-01-221-1/+1
| | | Move serialization dirty into serialization.rb
* put core at the beginning so other classes can modify the behaviorKeenan Brock2014-01-221-1/+1
|
* Refactor logic to grab the max time of the list of timestamp names in #cache_keyCarlos Antonio da Silva2013-11-041-2/+2
| | | | | Reuse the already existing logic used for grabbing this information from the updated columns.
* correct documentation about active_record behaviorSteven Yang2013-06-151-2/+2
|
* cache_key consults updated_on timestamp if presentBrendon Murphy2013-02-261-0/+6
| | | | | - Extract max timestamp retrieval for cache_key - Update changelog for cache_key changes
* Rename update_attributes method to update, keep update_attributes as an aliasAmparo Luna + Guillermo Iguaran2013-01-031-2/+2
|
* Remove not used load hooks for active_record_configCarlos Antonio da Silva2012-11-091-3/+0
| | | | | These were removed with ActiveRecord::Model in https://github.com/rails/rails/commit/9e4c41c903e8e58721f2c41776a8c60ddba7a0a9#L15L156
* Remove ActiveRecord::ModelJon Leighton2012-10-261-3/+2
| | | | | | | | | | 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-1/+1
| | | | This reverts commit 83846838252397b3781eed165ca301e05db39293.
* Get rid of the ActiveRecord::Model::DeprecationProxy thing.Jon Leighton2012-10-191-1/+1
| | | | | | | | | | | | | | | | | 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.
* Rename the partial_updates config to partial_writesJon Leighton2012-10-191-1/+1
| | | | This reflects the fact that it now impact inserts as well as updates.
* Call super to nullify the reference to the original errors object in the ↵Christian Seiler2012-10-161-0/+1
| | | | dup'ed object (call ActiveModel::Validations#initialize_dup). Closes #7291
* fix :nodoc:s in AR::Timestamp [ci skip]Francesco Rodriguez2012-09-191-7/+7
|
* load active_support/core_ext/class/attribute in active_support/railsXavier Noria2012-08-021-1/+0
|
* Simplify AR configuration code.Jon Leighton2012-06-151-2/+6
| | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* Support configuration on ActiveRecord::Model.Jon Leighton2011-12-281-1/+1
| | | | | | | | | | | | | | | 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.
* Allow instances to disable record_timestampsPratik Naik2011-10-261-1/+1
|
* Raise error when using write_attribute with a non-existent attribute.Jon Leighton2011-09-131-1/+3
| | | | | | | | | Previously we would just silently write the attribute. This can lead to subtle bugs (for example, see the change in AutosaveAssociation where a through association would wrongly gain an attribute. Also, ensuring that we never gain any new attributes after initialization will allow me to reduce our dependence on method_missing.
* Fix test failures on 1.8.7, since Object#initialize_dup is not defined there ↵Jon Leighton2011-08-291-1/+0
| | | | (and this call to super is no essential, so easiest to simply remove)
* Move clear_timestamp_attributes into Timestamp moduleJon Leighton2011-08-291-1/+13
|
* Updates to ActiveRecord::Timestamp documentation.Brian Morearty2011-02-051-6/+8
| | | | | | | | | | Change ActiveRecord::Base.xyz to config.active_record.xyz in docs. Remove <tt> from code samples. Update skip_time_zone_conversion_for_attributes code sample: put the call in the model class. Clarify that skip_time_zone_conversion_for_attributes skips converion when reading.
* Implement and test private method all_timestamp_attributes_in_modelFranck Verrot2011-02-021-0/+4
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Added timestamp_attributes_for_create_in_modelFranck Verrot2011-02-021-0/+4
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Make sure Model#touch doesn't try to update non existing columnsPratik Naik2010-12-301-1/+1
|
* class inheritable attributes is used no more! all internal use of class ↵Josh Kalderimis2010-11-201-3/+5
| | | | | | inheritable has been changed to class_attribute. class inheritable attributes has been deprecated. Signed-off-by: José Valim <jose.valim@gmail.com>
* Make should_record_timestamps? serialization aware rather than object#changed?Pratik Naik2010-11-021-1/+1
|
* Ensure timestamps are not generated when explicitly set to false [#5440 ↵José Valim2010-08-241-1/+1
| | | | state:resolved]
* Make update_attribute behave as in Rails 2.3 and document the behavior ↵José Valim2010-08-121-20/+19
| | | | intrinsic to its implementation.
* Merge remote branch 'docrails/master' into 3-0-stableXavier Noria2010-08-031-1/+2
|\
| * ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-021-1/+2
| |
* | Add an internal (private API) after_touch callback. [#5271 state:resolved]José Valim2010-08-021-13/+0
|/
* moving time zone related documentation to timestamp.rb from base.rbNeeraj Singh2010-07-291-0/+12
|
* Timestamp columns of HABTM join table should record timestampsNeeraj Singh2010-07-211-3/+16
| | | | [#5161 state:resolved]
* Tidying up a bit, so update_attribute is not called twice on touch.José Valim2010-07-131-15/+9
|
* with this fix touch method - does not call validations - doest not call ↵Neeraj Singh2010-07-131-9/+7
| | | | | | | | callbacks - updates updated_at/on along with attribute if attribute is provided - marks udpated_at/on and attribute as NOT changed [#2520 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Improve a bit the code in latest commits.José Valim2010-07-081-13/+7
|
* This patch changes update_attribute implementatino so:Neeraj Singh2010-07-081-2/+10
| | | | | | | | | | - it will only save the attribute it has been asked to save and not all dirty attributes - it does not invoke callbacks - it does change updated_at/on Signed-off-by: José Valim <jose.valim@gmail.com>
* consolidating updated_at and updated_onNeeraj Singh2010-07-081-9/+16
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Adds title and proper formatting to docs.Rizwan Reza2010-06-161-6/+12
|
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-26/+22
|
* Break up DependencyModule's dual function of providing a "depend_on" DSL and ↵Joshua Peek2009-05-281-1/+1
| | | | "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
* Use DependencyModule for included hooks in ActiveRecordBryan Helmkamp2009-05-111-5/+7
|
* Added :touch option to belongs_to associations that will touch the parent ↵David Heinemeier Hansson2009-04-161-3/+13
| | | | record when the current record is saved or destroyed [DHH]
* Added ActiveRecord::Base#touch to update the updated_at/on attributes with ↵David Heinemeier Hansson2009-04-161-9/+29
| | | | the current time [DHH]
* Ensure of Model#create support custom updated_at and updated_on attributes ↵Luis Hurtado2008-12-221-2/+2
| | | | | | [#1612 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Partial updates play nice with updated_at/on timestampsJeremy Kemper2008-03-311-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Partial updates include only unsaved attributes. Off by default; set ↵Jeremy Kemper2008-03-311-2/+2
| | | | | | YourClass.partial_updates = true to enable. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de