Module: SwitchPoint::Model

Defined in:
lib/switch_point/model.rb

Defined Under Namespace

Modules: ClassMethods, MonkeyPatch

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(model) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/switch_point/model.rb', line 6

def self.included(model)
  super
  model.singleton_class.class_eval do
    include ClassMethods
    prepend MonkeyPatch
  end
end

Instance Method Details

#transaction_with(*models, &block) ⇒ Object



22
23
24
# File 'lib/switch_point/model.rb', line 22

def transaction_with(*models, &block)
  self.class.transaction_with(*models, &block)
end

#with_readonly(&block) ⇒ Object



14
15
16
# File 'lib/switch_point/model.rb', line 14

def with_readonly(&block)
  self.class.with_readonly(&block)
end

#with_writable(&block) ⇒ Object



18
19
20
# File 'lib/switch_point/model.rb', line 18

def with_writable(&block)
  self.class.with_writable(&block)
end