Added plantings_count (i.e. counter_cache) to Member

Also removed the superfluous .plantings_count method on Crop, which was
causing some confusion.

A thing we learned today: we should use .size to find the size of
ActiveRecord collections, not .count, because .count doesn't use the
cache (while .size does).
This commit is contained in:
Skud
2013-08-26 12:41:10 +10:00
parent 73b7897c28
commit 42e3b5e04e
5 changed files with 18 additions and 2 deletions

View File

@@ -11,3 +11,6 @@ rake growstuff:oneoff:set_default_crop_creator
echo "2013-08-26 - set planting owner"
rake growstuff:oneoff:set_planting_owner
echo "2013-08-26 - initialize member planting count"
rake growstuff:oneoff:initialize_member_planting_count