cyrax 0.5.11 → 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cyrax.rb +9 -0
- data/lib/cyrax/extensions/has_service.rb +2 -2
- data/lib/cyrax/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: 8b9e7ee4eddd3653789dd875597d62305a654ce6
|
4
|
+
data.tar.gz: 993fb849adabe31de43bf04eca916c361cb0fe3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af20afd5e17a2916dd893b13c40ed75e51677bb04b4371e22d423c94243b7526263203438cc90e156f0ce50a9607c2160d15a7803213d97d3c91bed05f038d06
|
7
|
+
data.tar.gz: 5c401788d50e2d21cd96438871628cfd5e6942dad11a5ec601354dd0b1dffa54fc03546b6f1b6c13dba7b27f7c3907095d0fdea04e31ef40d3a636d725864577
|
data/lib/cyrax.rb
CHANGED
@@ -20,6 +20,7 @@ require "cyrax/serializer.rb"
|
|
20
20
|
|
21
21
|
module Cyrax
|
22
22
|
@@strong_parameters = true
|
23
|
+
@@automatically_set_invalid_status = true
|
23
24
|
|
24
25
|
def self.strong_parameters
|
25
26
|
@@strong_parameters
|
@@ -28,4 +29,12 @@ module Cyrax
|
|
28
29
|
def self.strong_parameters=(value)
|
29
30
|
@@strong_parameters = value
|
30
31
|
end
|
32
|
+
|
33
|
+
def self.automatically_set_invalid_status
|
34
|
+
@@automatically_set_invalid_status
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.automatically_set_invalid_status=(value)
|
38
|
+
@@automatically_set_invalid_status = value
|
39
|
+
end
|
31
40
|
end
|
@@ -36,7 +36,7 @@ module Cyrax::Extensions
|
|
36
36
|
if save_resource(resource)
|
37
37
|
set_message(:created)
|
38
38
|
block.call(resource) if block_given?
|
39
|
-
|
39
|
+
elsif Cyrax.automatically_set_invalid_status
|
40
40
|
set_status VALIDATION_ERROR_STATUS
|
41
41
|
end
|
42
42
|
end
|
@@ -66,7 +66,7 @@ module Cyrax::Extensions
|
|
66
66
|
if save_resource(resource)
|
67
67
|
set_message(:updated)
|
68
68
|
block.call(resource) if block_given?
|
69
|
-
|
69
|
+
elsif Cyrax.automatically_set_invalid_status
|
70
70
|
set_status VALIDATION_ERROR_STATUS
|
71
71
|
end
|
72
72
|
end
|
data/lib/cyrax/version.rb
CHANGED