pragma-operation 1.2.2 → 1.2.3
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de7f671cdcc96da6dcdfbeb86fe5fb18b779648b
|
4
|
+
data.tar.gz: 7114511c8435298744b6cc013c631ebc11a342f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a0ce612dbb5b9922a102ea07c94f1369306ef46c79187789d1d3ea89b0a84c67fdb55d2e508a922b6a7689a5e770417b11fce102e221de8d426764c20689289
|
7
|
+
data.tar.gz: 16a91000d9daa183a4f13b83187c381f7cee3e5ee0bc06dc555f07cc472b6a36fa2298c709d59c3b77597f94573dca2d0181c418d4bdc52ed2b2151cc258ac54
|
@@ -63,7 +63,7 @@ module Pragma
|
|
63
63
|
def authorize(authorizable)
|
64
64
|
return true unless self.class.policy_klass
|
65
65
|
|
66
|
-
policy = if authorizable.is_a?(self.class.policy_klass)
|
66
|
+
policy = if self.class.policy_klass && authorizable.is_a?(self.class.policy_klass)
|
67
67
|
authorizable
|
68
68
|
else
|
69
69
|
build_policy(authorizable)
|
@@ -65,7 +65,7 @@ module Pragma
|
|
65
65
|
#
|
66
66
|
# @return [Boolean] whether the operation is valid
|
67
67
|
def validate(validatable)
|
68
|
-
contract = if validatable.is_a?(self.class.contract_klass)
|
68
|
+
contract = if self.class.contract_klass && validatable.is_a?(self.class.contract_klass)
|
69
69
|
validatable
|
70
70
|
else
|
71
71
|
build_contract(validatable)
|
@@ -84,8 +84,7 @@ module Pragma
|
|
84
84
|
#
|
85
85
|
# @param validatable [Object|Pragma::Contract::Base] contract or resource
|
86
86
|
def validate!(validatable)
|
87
|
-
|
88
|
-
contract = if defined?(Pragma::Contract::Base) && validatable.is_a?(Pragma::Contract::Base)
|
87
|
+
contract = if self.class.contract_klass && validatable.is_a?(self.class.contract_klass)
|
89
88
|
validatable
|
90
89
|
else
|
91
90
|
build_contract(validatable)
|