Module: Ixtlan::Optimistic::DataMapper

Defined in:
lib/ixtlan/optimistic/data_mapper.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ixtlan/optimistic/data_mapper.rb', line 27

def self.included(base)
  base.extend StaleCheck
  base.class_eval do

    def self.optimistic_get(updated_at, *args) 
      __check( updated_at )
      result = get( *args )
      if result
        __check_stale( updated_at, result )
      end
    end
 
    def self.optimistic_get!(updated_at, *args)
      __check( updated_at )
      result = get!( *args )
      __check_stale( updated_at, result )
    end
  end
end