1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

3 commits

Author SHA1 Message Date
Stefan Kanev
0ed096ddf5 Fix counter_cache for polymorphic associations
Also removes a false positive test that depends on the fixed bug:

At this time, counter_cache does not work with polymorphic relationships
(which is a bug). The test was added to make sure that no
StaleObjectError is raised when the car is destroyed. No such error is
currently raised because the lock version is not incremented by
appending a wheel to the car.

Furthermore, `assert_difference` succeeds because `car.wheels.count`
does not check the counter cache, but the collection size. The test will
fail if it is replaced with `car.wheels_count || 0`.
2015-07-19 15:52:29 -06:00
Guillermo Iguaran
23e94a67f8 Refactoring test_has_many_with_pluralize_table_names_false test 2011-05-20 01:53:13 -05:00
Guillermo Iguaran
ecbde46e57 Fixing has_many association when ActiveRecord::Base.pluralize_table_names is false. fixes #557 2011-05-15 03:53:10 -05:00