I am using Ruby on Rails 3.0.9 and I am trying to refresh a database query result.
My data flow is the following:
Articles::UserRelationship.where(:user_id => user.id).count # Load data
@article.save
Articles::UserRelationship.where(:user_id => user.id).count # Load cached data
On the second time I load the Articles::UserRelationship I would like to not load cached data so that I can retrieve that refreshed.
How can I do since the above code load always cached data for the second statement?
P.S.: I tried to use the reload method but it seams don’t work.
you can adjust ActiveRecord config to disable query cache:
API references is on github
try this out