Skip to content

Instantly share code, notes, and snippets.

@Godoy Godoy/gist:6564097

Created Sep 14, 2013
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.

Copy link
Owner Author

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
You can’t perform that action at this time.