mongoid_ability 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid_ability/lock.rb +1 -1
- data/lib/mongoid_ability/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f2f18aa441d6339b6ddc2cd386d443efcd31df4
|
4
|
+
data.tar.gz: 5822292aba839c934257bafe1b139eb78ed3a480
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac4170560d19f57e22c226e080a7fee86bbca9f6e7dcad1a022ee5c693f6ec652f663f866b40ba97dbd0e875f4f40349207e53372d258f33c4b865ac4e94041e
|
7
|
+
data.tar.gz: 8463bdda383dfb9561a7b467e33d9779b18d655333a3f45bd498ae7f73cdadb1965308e2c933ea5ed8957dc5c27cbbea782eb4ecf0546eed5d5ac80441068911
|
data/lib/mongoid_ability/lock.rb
CHANGED
@@ -17,7 +17,7 @@ module MongoidAbility
|
|
17
17
|
scope :for_action, -> action { where(action: action.to_sym) }
|
18
18
|
|
19
19
|
scope :for_subject_type, -> subject_type { where(subject_type: subject_type.to_s) }
|
20
|
-
scope :for_subject_id, -> subject_id { where(subject_id: subject_id) }
|
20
|
+
scope :for_subject_id, -> subject_id { where(subject_id: subject_id.presence) }
|
21
21
|
scope :for_subject, -> subject { where(subject_type: subject.class.model_name, subject_id: subject.id) }
|
22
22
|
|
23
23
|
scope :class_locks, -> { where(subject_id: nil) }
|