Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
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



36
37
38
39
40
41
42
# File 'lib/cache_money.rb', line 36

def <=>(other)
  if self.id == other.id then 
    0
  else
    self.id < other.id ? -1 : 1
  end
end