I want to create a base class for a few of my models, as follows:
class SingletonRecord < ActiveRecord::Base
instance = self.find_all
instance ||= Current.new
def save self.delete_all super end
Then I create a subclass model like so:
class Current < SingletonRecord
This works great in the console, i.e. Current.get does what I’d expect.
But it doesn’t work through the web interface - it tells me
“SingletonRecord uninitialized constant”.