modify_resource 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -216,8 +216,13 @@ module ActionController
|
|
216
216
|
parent_class = parents.first.classify.constantize
|
217
217
|
parent_name = parent_class.model_name.downcase
|
218
218
|
parent_param = parent_name + '_id'
|
219
|
-
|
220
|
-
|
219
|
+
return unless params[parent_param].present?
|
220
|
+
|
221
|
+
begin
|
222
|
+
parent = parent_class.find(params[parent_param])
|
223
|
+
rescue ActiveRecord::RecordNotFound
|
224
|
+
return # Parent id wasn't given in parameters. Let's let the model validations handle this.
|
225
|
+
end
|
221
226
|
|
222
227
|
instance_variable_set :"@#{parent_name}", parent
|
223
228
|
|
metadata
CHANGED
@@ -1,55 +1,56 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: modify_resource
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Colin Young
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2013-03-25 00:00:00 -04:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: require_all
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
name: rake
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
38
30
|
type: :runtime
|
31
|
+
version_requirements: *id001
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: rake
|
39
34
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
41
|
+
version: "0"
|
42
|
+
type: :runtime
|
43
|
+
version_requirements: *id002
|
46
44
|
description: This gem makes rails automatic. Securely.
|
47
|
-
email:
|
45
|
+
email:
|
48
46
|
- me@colinyoung.com
|
49
47
|
executables: []
|
48
|
+
|
50
49
|
extensions: []
|
50
|
+
|
51
51
|
extra_rdoc_files: []
|
52
|
-
|
52
|
+
|
53
|
+
files:
|
53
54
|
- .gitignore
|
54
55
|
- Gemfile
|
55
56
|
- LICENSE.txt
|
@@ -66,30 +67,36 @@ files:
|
|
66
67
|
- modify_resource.gemspec
|
67
68
|
- test/modify_resource_test.rb
|
68
69
|
- test/test_helper.rb
|
69
|
-
|
70
|
+
has_rdoc: true
|
71
|
+
homepage: ""
|
70
72
|
licenses: []
|
73
|
+
|
71
74
|
post_install_message:
|
72
75
|
rdoc_options: []
|
73
|
-
|
76
|
+
|
77
|
+
require_paths:
|
74
78
|
- lib
|
75
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
version: "0"
|
87
93
|
requirements: []
|
94
|
+
|
88
95
|
rubyforge_project:
|
89
|
-
rubygems_version: 1.
|
96
|
+
rubygems_version: 1.3.6
|
90
97
|
signing_key:
|
91
98
|
specification_version: 3
|
92
99
|
summary: stop writing the same controller actions for resources
|
93
|
-
test_files:
|
100
|
+
test_files:
|
94
101
|
- test/modify_resource_test.rb
|
95
102
|
- test/test_helper.rb
|