| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
timestamps. [#18202]
|
| |
|
|
|
|
|
|
| |
I've been trying to reduce the number of places that care about
`attributes`, and its existence. We have a method for this check, let's
use it instead.
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
greyblake/dont_write_timestamps_if_they_are_not_attributes
Write timestamps only if there are timestamps columns
Conflicts:
activerecord/CHANGELOG.md
|
| | |
|
| | |
|
| |
| |
| |
| | |
`[].max # => nil`
|
|/
|
|
|
|
| |
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 serialization dirty into serialization.rb
|
| |
|
|
|
|
|
| |
Reuse the already existing logic used for grabbing this information from
the updated columns.
|
| |
|
|
|
|
|
| |
- Extract max timestamp retrieval for cache_key
- Update changelog for cache_key changes
|
| |
|
|
|
|
|
| |
These were removed with ActiveRecord::Model in
https://github.com/rails/rails/commit/9e4c41c903e8e58721f2c41776a8c60ddba7a0a9#L15L156
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This reverts commit 83846838252397b3781eed165ca301e05db39293.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This reflects the fact that it now impact inserts as well as updates.
|
|
|
|
| |
dup'ed object (call ActiveModel::Validations#initialize_dup). Closes #7291
|
| |
|
| |
|
|
|
|
|
| |
Get rid of ActiveModel::Configuration, make better use of
ActiveSupport::Concern + class_attribute, etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
(and this call to super is no essential, so easiest to simply remove)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
| |
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
| |
|
|
|
|
|
|
| |
inheritable has been changed to class_attribute. class inheritable attributes has been deprecated.
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
| |
state:resolved]
|
|
|
|
| |
intrinsic to its implementation.
|
|\ |
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
[#5161 state:resolved]
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
| |
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
| |
|
|
|
|
| |
"included" block DSL into separate modules. But, unify both approaches under AS::Concern.
|