inossidabile / protector

Comfortable (seriously) white-list security restrictions for models on a field level
MIT License
270 stars 31 forks source link

Deprecation Warning: Modifying already cached Relation. The cache will be reset. Use a cloned Relation to prevent this warning. #73

Open bernespinoza opened 6 years ago

bernespinoza commented 6 years ago

what?

This warning is appearing when protector calls exec_queries_with_protector and protector_substitute_includes According to this rails commit https://github.com/rails/rails/commit/1b7aa62b184c4410c99208f71b59bbac5c5f03be

It happens when you are modifying an already cached arel.

ActiveRecord versions

v4.2.10 v4.2.10.rc1 v4.2.9 v4.2.9.rc2 v4.2.9.rc1 v4.2.8 v4.2.8.rc1 v4.2.7.1 v4.2.7 v4.2.7.rc1 v4.2.6 v4.2.6.rc1 v4.2.5.2 v4.2.5.1 v4.2.5 v4.2.5.rc2 v4.2.5.rc1 v4.2.4 v4.2.4.rc1 v4.2.3 v4.2.3.rc1 v4.2.2 v4.2.1 v4.2.1.rc4 v4.2.1.rc3 v4.2.1.rc2 v4.2.1.rc1 v4.2.0 v4.2.0.rc3 v4.2.0.rc2 v4.2.0.rc1 v4.2.0.beta4 v4.2.0.beta3 v4.2.0.beta2 v4.2.0.beta1