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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a7df346477f2df952f07d3aecb3424e19b13309
4
- data.tar.gz: 1a68816f86ebeaf1690af84048f9f98b54b27848
3
+ metadata.gz: 8b9e7ee4eddd3653789dd875597d62305a654ce6
4
+ data.tar.gz: 993fb849adabe31de43bf04eca916c361cb0fe3e
5
5
  SHA512:
6
- metadata.gz: 2318b14712827861174e716805c80b7e57d2793c2b7ae73b8cb0555302d7fe5a4e6f84611686c62a23c00734c7c2180e1528cff069d2cad09097c4e91b19ea50
7
- data.tar.gz: b1c2c7e0dc9df63514c7f768e138391f9124af658bea032b71b72246d8ead5347809d53de89ae72004ab9bac9118cebf08be7e899f560b0d261064b6c50abef9
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
- else
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
- else
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
@@ -1,3 +1,3 @@
1
1
  module Cyrax
2
- VERSION = "0.5.11"
2
+ VERSION = "0.5.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Droidlabs