1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases
Arthur Neves e7c48db509 Make sure we touch all the parents when touch_later.
The problem was that when saving an object, we would
call touch_later on the parent which wont be saved immediteally, and
it wont call any callbacks. That was working one level up because
we were calling touch, during the touch_later commit phase. However that still
didnt solve the problem when you have a 3+ levels of parents to be touched,
as calling touch would affect the parent, but it would be too late to run callbacks
on its grand-parent.

The solution for this, is instead, call touch_later upwards when the first
touch_later is called. So we make sure all the timestamps are updated without relying
on callbacks.

This also removed the hard dependency BelongsTo builder had with the TouchLater module.
So we can still have the old behaviour if TouchLater module is not included.

[fixes 5f5e6d9249]
[related #19324]
2015-12-06 16:53:00 -05:00
..
adapters
associations
attribute_methods
coders
connection_adapters
connection_specification
fixture_set
migration
relation
scoping
tasks
type
validations
adapter_test.rb
aggregations_test.rb
ar_schema_test.rb
associations_test.rb
attribute_decorators_test.rb
attribute_methods_test.rb
attribute_set_test.rb
attribute_test.rb
attributes_test.rb
autosave_association_test.rb
base_test.rb
batches_test.rb
binary_test.rb
bind_parameter_test.rb
cache_key_test.rb
calculations_test.rb
callbacks_test.rb
clone_test.rb
collection_cache_key_test.rb
column_alias_test.rb
column_definition_test.rb
connection_management_test.rb
connection_pool_test.rb
core_test.rb
counter_cache_test.rb
custom_locking_test.rb
database_statements_test.rb
date_time_precision_test.rb
date_time_test.rb
defaults_test.rb
dirty_test.rb
disconnected_test.rb
dup_test.rb
enum_test.rb
errors_test.rb
explain_subscriber_test.rb
explain_test.rb
finder_respond_to_test.rb
finder_test.rb
fixtures_test.rb
forbidden_attributes_protection_test.rb
habtm_destroy_order_test.rb
helper.rb
hot_compatibility_test.rb
i18n_test.rb
inheritance_test.rb
integration_test.rb
invalid_connection_test.rb
invalid_date_test.rb
invertible_migration_test.rb
json_serialization_test.rb
locking_test.rb
log_subscriber_test.rb
migration_test.rb
migrator_test.rb
mixin_test.rb
modules_test.rb
multiparameter_attributes_test.rb
multiple_db_test.rb
nested_attributes_test.rb
nested_attributes_with_callbacks_test.rb
persistence_test.rb
pooled_connections_test.rb
primary_keys_test.rb
query_cache_test.rb
quoting_test.rb
readonly_test.rb
reaper_test.rb
reflection_test.rb
relation_test.rb
relations_test.rb
reload_models_test.rb
result_test.rb
sanitize_test.rb
schema_dumper_test.rb
secure_token_test.rb
serialization_test.rb
serialized_attribute_test.rb
statement_cache_test.rb
store_test.rb
suppressor_test.rb
test_case.rb
test_fixtures_test.rb
time_precision_test.rb
timestamp_test.rb
touch_later_test.rb Make sure we touch all the parents when touch_later. 2015-12-06 16:53:00 -05:00
transaction_callbacks_test.rb
transaction_isolation_test.rb
transactions_test.rb
type_test.rb
types_test.rb
unconnected_test.rb
validations_repair_helper.rb
validations_test.rb
view_test.rb
yaml_serialization_test.rb