Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

transactions as class methods

  • Loading branch information...
commit c04b243fcf3fa7ba54d9c7b2c1fa7b6ffa49d46a 1 parent dc091b0
Felix Hanley felix authored Jeremy Nicoll committed

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 3 lib/dm-is-awesome_set.rb
6 lib/dm-is-awesome_set.rb
@@ -157,7 +157,7 @@ module InstanceMethods
157 157 # @see move_without_saving
158 158
159 159 def move(vector)
160   - transaction do
  160 + get_class.transaction do
161 161 move_without_saving(vector)
162 162 save!
163 163 end
@@ -249,7 +249,7 @@ def destroy
249 249 # Trigger all the before :destroy methods
250 250 sads.each { |sad| before_methods.each { |bf| sad.send(bf) } }
251 251 # dup is called here because destroy! likes to clear out the array, understandably.
252   - transaction do
  252 + get_class.transaction do
253 253 sads.dup.destroy!
254 254 adjust_gap!(full_set, lft, -(rgt - lft + 1))
255 255 end
@@ -260,7 +260,7 @@ def destroy
260 260 # Same as @destroy, but does not run the hooks
261 261 def destroy!
262 262 sad = self_and_descendants
263   - transaction do
  263 + get_class.transaction do
264 264 sad.dup.destroy!
265 265 adjust_gap!(full_set, lft, -(rgt - lft + 1))
266 266 end

0 comments on commit c04b243

Please sign in to comment.
Something went wrong with that request. Please try again.