mongomatic 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/mongomatic/base.rb +5 -1
  2. metadata +2 -2
@@ -312,7 +312,11 @@ module Mongomatic
312
312
 
313
313
  def transaction(key=nil, duration=5, &block)
314
314
  raise Mongomatic::Exceptions::DocumentIsNew if new?
315
- key ||= [self.class.name, self["_id"].to_s].join("-")
315
+ if key.is_a?(Hash) && key[:scope]
316
+ key = [self.class.name, self["_id"].to_s, key[:scope]].join("-")
317
+ else
318
+ key ||= [self.class.name, self["_id"].to_s].join("-")
319
+ end
316
320
  TransactionLock.start(key, duration, &block)
317
321
  end
318
322
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 2
9
- version: 0.7.2
8
+ - 3
9
+ version: 0.7.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben Myles