modify_resource 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -44,8 +44,7 @@ module ActionController
|
|
44
44
|
private
|
45
45
|
|
46
46
|
def add_user_id_to(hash_or_user, user_hash)
|
47
|
-
return unless hash_or_user.present?
|
48
|
-
raise UserNotProvidedError unless user = user_hash[:as]
|
47
|
+
return unless hash_or_user.present? and user = user_hash[:as]
|
49
48
|
user_class = user.class.model_name.downcase.underscore # 'user', etc.
|
50
49
|
|
51
50
|
case hash_or_user
|
@@ -59,7 +58,7 @@ module ActionController
|
|
59
58
|
def update_resource(*args) # resource, (optional: fields=[]), user_hash={}
|
60
59
|
resource = args.first
|
61
60
|
user_hash = args.last
|
62
|
-
|
61
|
+
return unless user = user_hash[:as]
|
63
62
|
fields = args[1] if args.count > 2
|
64
63
|
|
65
64
|
resource_name = resource.class.name.downcase
|
@@ -82,6 +81,3 @@ module ActionController
|
|
82
81
|
end
|
83
82
|
end
|
84
83
|
end
|
85
|
-
|
86
|
-
class UserNotProvidedError < StandardError
|
87
|
-
end
|
metadata
CHANGED
@@ -1,56 +1,55 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: modify_resource
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
version: 0.0.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Colin Young
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-04-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: require_all
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
|
28
|
-
- 0
|
29
|
-
version: "0"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
30
22
|
type: :runtime
|
31
|
-
version_requirements: *id001
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
name: rake
|
34
23
|
prerelease: false
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
42
38
|
type: :runtime
|
43
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
44
46
|
description: This gem makes rails automatic. Securely.
|
45
|
-
email:
|
47
|
+
email:
|
46
48
|
- me@colinyoung.com
|
47
49
|
executables: []
|
48
|
-
|
49
50
|
extensions: []
|
50
|
-
|
51
51
|
extra_rdoc_files: []
|
52
|
-
|
53
|
-
files:
|
52
|
+
files:
|
54
53
|
- .gitignore
|
55
54
|
- Gemfile
|
56
55
|
- LICENSE.txt
|
@@ -67,36 +66,30 @@ files:
|
|
67
66
|
- modify_resource.gemspec
|
68
67
|
- test/modify_resource_test.rb
|
69
68
|
- test/test_helper.rb
|
70
|
-
|
71
|
-
homepage: ""
|
69
|
+
homepage: ''
|
72
70
|
licenses: []
|
73
|
-
|
74
71
|
post_install_message:
|
75
72
|
rdoc_options: []
|
76
|
-
|
77
|
-
require_paths:
|
73
|
+
require_paths:
|
78
74
|
- lib
|
79
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
- 0
|
92
|
-
version: "0"
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
93
87
|
requirements: []
|
94
|
-
|
95
88
|
rubyforge_project:
|
96
|
-
rubygems_version: 1.
|
89
|
+
rubygems_version: 1.8.23
|
97
90
|
signing_key:
|
98
91
|
specification_version: 3
|
99
92
|
summary: stop writing the same controller actions for resources
|
100
|
-
test_files:
|
93
|
+
test_files:
|
101
94
|
- test/modify_resource_test.rb
|
102
95
|
- test/test_helper.rb
|