Adds test to prove that there is an error when a lambda is used for updating counterCache
Prevent counterCache error when updating foreignkey with lambda counter
Merge pull request #4846 from dakota/3.0-counter-cache

3.0 counter cache error with lambda counters