mikeycgto-sinatra-rest 0.4.2 → 0.4.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/sinatra/rest/rest.yaml +2 -2
  2. metadata +2 -2
@@ -27,7 +27,7 @@
27
27
  @SINGULAR = call_model_method(MODEL, :new, mp)
28
28
  @SINGULAR.save
29
29
  :render: |-
30
- unless @SINGULAR.invalid?
30
+ if @SINGULAR.errors.empty?
31
31
  redirect url_for_PLURAL_show(@SINGULAR), 'SINGULAR created'
32
32
  else
33
33
  if request.xhr?
@@ -72,7 +72,7 @@
72
72
  if @SINGULAR.nil?
73
73
  throw :halt, [404, 'SINGULAR not found']
74
74
  else
75
- unless @SINGULAR.invalid?
75
+ if @SINGULAR.errors.empty?
76
76
  redirect url_for_PLURAL_show(@SINGULAR), 'SINGULAR updated'
77
77
  else
78
78
  if request.xhr?
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 2
9
- version: 0.4.2
8
+ - 3
9
+ version: 0.4.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - blindgaenger