Module: Ixtlan::OptimisticPersistenceValidation

Defined in:
lib/ixtlan/optimistic_persistence_validation.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/ixtlan/optimistic_persistence_validation.rb', line 8

def self.included(base)
  base.send(:include, ::Ixtlan::OptimisticPersistenceModule)
  base.validates_with_block :stale do
    if(stale?)
      [false, "stale resource, please reload the resource"]
    else
      true
    end
  end
end