ThoKra ThoKra - 1 year ago 137
SQL Question

Disable SQL Cache temporary in Rails?

I'm currently creating a Rails app with some cronjobs etc, but I have some problems because the sql is cached by Rails.

So anyone know how to disable the SQL Cache in Rails? Not globally, but for this code. Really don't want to create one method for every model, so is there anyway to just disable it temporary?


Answer Source

Solved with model.connection.clear_query_cache

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download