Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails console: Does rails console maintain cache for database tables? How to disable that?

I got fk parent/child row deletion/update errors while performing deletion on parent row.So I removed related child records from database manually. But still i am getting errors. I presume it is related to cache. One more thing i must mention here is that when i see child records, it shows me updated state of table i.e. deleted records are not visible(that may be because i fired that query first time).

like image 235
Maddy.Shik Avatar asked Dec 12 '22 14:12

Maddy.Shik


2 Answers

Yeah whenever you make any changes to the database or for that matter even code, it wont reflect in the console, you need to do reload! e.g

ree-1.8.7-2010.02 > reload!
Reloading...
 => true 
ree-1.8.7-2010.02 > 
like image 137
Shiv Avatar answered Dec 29 '22 12:12

Shiv


Add config.action_controller.perform_caching = false

in environment/*.rb

like image 28
Maddy.Shik Avatar answered Dec 29 '22 12:12

Maddy.Shik