I have a button which is sending a get request over XHR to a specific action in a rails server. This action calls a function I defined in the model \"Category\". This functi
Finally solved! After posting a third question and with help of trptcolin, I could confirm a working solution.
The problem: I was using require
to include models from within Table-less models (classes that are in app/models but do not extend ActiveRecord::Base). For example, I had a class FilterCategory
that performed require 'category'
. This messed up with Rails' class caching.
I had to use require
in the first place since lines such as Category.find :all
failed.
The solution (credit goes to trptcolin): replace Category.find :all
with ::Category.find :all
. This works without the need to explicitly require any model, and therefore doesn't cause any class caching problems.
The "stack too deep" problem also goes away when using config.active_record.default_timezone = :utc