rails-add_ons 2.2.0 → 2.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c7c4f39bddae1458684c318b7c5eb56192a5807
|
4
|
+
data.tar.gz: 837bb68a45e06765a53361094424189022aac308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b3ea72bef606239b4f36ef3a3f968cade7414a163fed52b017065206141ccef0bb73a00db0cc66dbd9cc37259425e97834e50702e34f67e40b15c353226c5e6
|
7
|
+
data.tar.gz: 1e719c48c0dfece1b0a28c9cbfe0b2084b70527a551a3c16f20b0b58aa10b47e4ab307c80447fc38b04ca3cb5c129c772cf0678b7ee75c0eff854f2088432b1d
|
@@ -27,13 +27,7 @@ module ResourcesController
|
|
27
27
|
def edit; end
|
28
28
|
|
29
29
|
def update
|
30
|
-
if
|
31
|
-
@resource.update_attributes(permitted_params)
|
32
|
-
else
|
33
|
-
@resource.update(permitted_params)
|
34
|
-
end
|
35
|
-
|
36
|
-
if respond_to?(:after_update_location, true)
|
30
|
+
if @resource.send(update_method_name, permitted_params) && respond_to?(:after_update_location, true)
|
37
31
|
respond_with(respond_with_namespace, @resource, location: after_update_location)
|
38
32
|
else
|
39
33
|
respond_with(respond_with_namespace, @resource)
|
@@ -50,8 +44,7 @@ module ResourcesController
|
|
50
44
|
end
|
51
45
|
|
52
46
|
def create
|
53
|
-
@resource.save
|
54
|
-
if respond_to?(:after_create_location, true)
|
47
|
+
if @resource.save && respond_to?(:after_create_location, true)
|
55
48
|
respond_with(respond_with_namespace, @resource, location: after_create_location)
|
56
49
|
else
|
57
50
|
respond_with(respond_with_namespace, @resource)
|
@@ -60,6 +53,10 @@ module ResourcesController
|
|
60
53
|
|
61
54
|
private
|
62
55
|
|
56
|
+
def update_method_name
|
57
|
+
Rails::VERSION::MAJOR < 4 ? :update_attributes : :update
|
58
|
+
end
|
59
|
+
|
63
60
|
def respond_with_namespace
|
64
61
|
nil
|
65
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-add_ons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|