Instantly share code, notes, and snippets.

What would you like to do?
"Re-salvar" todos os registros de determinado model no console do rails (para que executem algum novo before_filter, por exemplo)

This comment has been minimized.


Godoy commented Jan 2, 2017

Resetar contadores counter_cache: Post.all.each { |p| Post.reset_counters(, :comments) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment