Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cash/util/active_record.rb,
lib/cache_money.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.is_cached(options = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/cache_money.rb', line 26

def self.is_cached(options = {})
  if options == false
    include NoCash
  else
    options.assert_valid_keys(:ttl, :repository, :version)
    include Cash unless ancestors.include?(Cash)
    Cash::Config.create(self, options)
  end
end

Instance Method Details

#<=>(other) ⇒ Object



2
3
4
# File 'lib/cash/util/active_record.rb', line 2

def <=>(other)
  self.id.to_i <=> other.id.to_i
end