master_slave_adapter_tcurdt 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -153,13 +153,26 @@ module ActiveRecord
|
|
|
153
153
|
|
|
154
154
|
def transaction(*args)
|
|
155
155
|
# puts "<transaction"
|
|
156
|
-
yield
|
|
156
|
+
result = yield
|
|
157
157
|
# puts "</transaction"
|
|
158
158
|
update_clock
|
|
159
|
+
result
|
|
159
160
|
end
|
|
160
161
|
|
|
161
162
|
class << self
|
|
162
163
|
|
|
164
|
+
def with_master(&block)
|
|
165
|
+
ActiveRecord::Base.with_master(&block)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def with_slave(&block)
|
|
169
|
+
ActiveRecord::Base.with_slave(&block)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def with_consitency(clock, &block)
|
|
173
|
+
ActiveRecord::Base.with_slave(clock, &block)
|
|
174
|
+
end
|
|
175
|
+
|
|
163
176
|
def reset!
|
|
164
177
|
Thread.current[:master_slave_connection] = nil
|
|
165
178
|
Thread.current[:master_slave_clock] = nil
|