Uninitialized constant ActiveRecord::Singleton
I need to define a singleton ActiveRecord model. I do this:
class Universe < ActiveRecord::Base
include ActiveRecord::Singleton
end
But I receive an error: uninitialized constant ActiveRecord开发者_如何学JAVA::Singleton. I assume, I missed require "something". What should I require?
I searched through the Rails documentation for 3.03 and I don't see any reference to ActiveRecord::Singleton. Are you absolutely sure this is a valid name?
I did find a reference to this library that appears to add this functionality though. Are you using this library?
Are you sure you are actually looking for ActiveRecord::Singleton? There is a Singleton-Module in the rails-standard-library:
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/singleton/rdoc/Singleton.html
maybe this is what you are looking for?!
精彩评论