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



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

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



24
25
26
# File 'lib/switch_point/model.rb', line 24

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

#with_readonly(&block) ⇒ Object



16
17
18
# File 'lib/switch_point/model.rb', line 16

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

#with_writable(&block) ⇒ Object



20
21
22
# File 'lib/switch_point/model.rb', line 20

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