Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/acts_as_singleton.rb

Class Method Summary collapse

Class Method Details

.acts_as_singletonObject

Class method to provide a more Rails-like experience. Merely includes the ActiveRecord::Singleton module.

class HomepageSettings < ActiveRecord::Base
  acts_as_singleton # Equivalent to "include ActiveRecord::Singleton".
end


89
90
91
# File 'lib/acts_as_singleton.rb', line 89

def acts_as_singleton
  include Singleton
end