dm-rails 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/dm-rails.gemspec +8 -8
- data/lib/dm-rails/mass_assignment_security.rb +3 -3
- metadata +63 -116
data/Gemfile
CHANGED
@@ -7,7 +7,7 @@ REPO_POSTFIX = SOURCE == :path ? '' : '.git'
|
|
7
7
|
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
|
8
8
|
DM_VERSION = '~> 1.2.0'
|
9
9
|
DO_VERSION = '~> 0.10.6'
|
10
|
-
RAILS_VERSION = '~> 3.
|
10
|
+
RAILS_VERSION = '~> 3.0'
|
11
11
|
DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
|
12
12
|
CURRENT_BRANCH = ENV.fetch('GIT_BRANCH', 'master')
|
13
13
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/dm-rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "dm-rails"
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Martin Gamsjaeger (snusnu)", "Dan Kubb"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2012-02-15"
|
13
13
|
s.description = "Integrate DataMapper with Rails 3"
|
14
14
|
s.email = "gamsnjaga@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -67,16 +67,16 @@ Gem::Specification.new do |s|
|
|
67
67
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
68
68
|
s.add_runtime_dependency(%q<dm-core>, ["~> 1.2.0"])
|
69
69
|
s.add_runtime_dependency(%q<dm-active_model>, ["~> 1.2.0"])
|
70
|
-
s.add_runtime_dependency(%q<actionpack>, ["~> 3.
|
71
|
-
s.add_runtime_dependency(%q<railties>, ["~> 3.
|
70
|
+
s.add_runtime_dependency(%q<actionpack>, ["~> 3.0"])
|
71
|
+
s.add_runtime_dependency(%q<railties>, ["~> 3.0"])
|
72
72
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
73
73
|
s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
|
74
74
|
s.add_development_dependency(%q<rspec>, ["~> 1.3.2"])
|
75
75
|
else
|
76
76
|
s.add_dependency(%q<dm-core>, ["~> 1.2.0"])
|
77
77
|
s.add_dependency(%q<dm-active_model>, ["~> 1.2.0"])
|
78
|
-
s.add_dependency(%q<actionpack>, ["~> 3.
|
79
|
-
s.add_dependency(%q<railties>, ["~> 3.
|
78
|
+
s.add_dependency(%q<actionpack>, ["~> 3.0"])
|
79
|
+
s.add_dependency(%q<railties>, ["~> 3.0"])
|
80
80
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
81
81
|
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
82
82
|
s.add_dependency(%q<rspec>, ["~> 1.3.2"])
|
@@ -84,8 +84,8 @@ Gem::Specification.new do |s|
|
|
84
84
|
else
|
85
85
|
s.add_dependency(%q<dm-core>, ["~> 1.2.0"])
|
86
86
|
s.add_dependency(%q<dm-active_model>, ["~> 1.2.0"])
|
87
|
-
s.add_dependency(%q<actionpack>, ["~> 3.
|
88
|
-
s.add_dependency(%q<railties>, ["~> 3.
|
87
|
+
s.add_dependency(%q<actionpack>, ["~> 3.0"])
|
88
|
+
s.add_dependency(%q<railties>, ["~> 3.0"])
|
89
89
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
90
90
|
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
91
91
|
s.add_dependency(%q<rspec>, ["~> 1.3.2"])
|
@@ -8,17 +8,17 @@ module ActiveModel
|
|
8
8
|
# Provides a patched version of the Sanitizer used in Rails to handle property
|
9
9
|
# and relationship objects as keys. There is no way to inject a custom sanitizer
|
10
10
|
# without reimplementing the permission sets.
|
11
|
-
|
11
|
+
Sanitizer.send(Sanitizer.is_a?(Module) ? :module_eval : :class_eval) do
|
12
12
|
# Returns all attributes not denied by the authorizer.
|
13
13
|
#
|
14
14
|
# @param [Hash{Symbol,String,::DataMapper::Property,::DataMapper::Relationship=>Object}] attributes
|
15
15
|
# Names and values of attributes to sanitize.
|
16
16
|
# @return [Hash]
|
17
17
|
# Sanitized hash of attributes.
|
18
|
-
def sanitize(attributes)
|
18
|
+
def sanitize(attributes, authorizer = nil)
|
19
19
|
sanitized_attributes = attributes.reject do |key, value|
|
20
20
|
key_name = key.name rescue key
|
21
|
-
deny?(key_name)
|
21
|
+
authorizer ? authorizer.deny?(key_name) : deny?(key_name)
|
22
22
|
end
|
23
23
|
debug_protected_attribute_removal(attributes, sanitized_attributes)
|
24
24
|
sanitized_attributes
|
metadata
CHANGED
@@ -1,145 +1,102 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 1.2.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Martin Gamsjaeger (snusnu)
|
14
9
|
- Dan Kubb
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2012-02-15 00:00:00.000000000Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
22
16
|
name: dm-core
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &70172354940660 !ruby/object:Gem::Requirement
|
25
18
|
none: false
|
26
|
-
requirements:
|
19
|
+
requirements:
|
27
20
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 31
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 2
|
33
|
-
- 0
|
21
|
+
- !ruby/object:Gem::Version
|
34
22
|
version: 1.2.0
|
35
23
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: dm-active_model
|
39
24
|
prerelease: false
|
40
|
-
|
25
|
+
version_requirements: *70172354940660
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: dm-active_model
|
28
|
+
requirement: &70172354940180 !ruby/object:Gem::Requirement
|
41
29
|
none: false
|
42
|
-
requirements:
|
30
|
+
requirements:
|
43
31
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 31
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 2
|
49
|
-
- 0
|
32
|
+
- !ruby/object:Gem::Version
|
50
33
|
version: 1.2.0
|
51
34
|
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: actionpack
|
55
35
|
prerelease: false
|
56
|
-
|
36
|
+
version_requirements: *70172354940180
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: actionpack
|
39
|
+
requirement: &70172354939700 !ruby/object:Gem::Requirement
|
57
40
|
none: false
|
58
|
-
requirements:
|
41
|
+
requirements:
|
59
42
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
segments:
|
63
|
-
- 3
|
64
|
-
- 1
|
65
|
-
- 0
|
66
|
-
version: 3.1.0
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '3.0'
|
67
45
|
type: :runtime
|
68
|
-
version_requirements: *id003
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: railties
|
71
46
|
prerelease: false
|
72
|
-
|
47
|
+
version_requirements: *70172354939700
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: railties
|
50
|
+
requirement: &70172354939220 !ruby/object:Gem::Requirement
|
73
51
|
none: false
|
74
|
-
requirements:
|
52
|
+
requirements:
|
75
53
|
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
segments:
|
79
|
-
- 3
|
80
|
-
- 1
|
81
|
-
- 0
|
82
|
-
version: 3.1.0
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '3.0'
|
83
56
|
type: :runtime
|
84
|
-
version_requirements: *id004
|
85
|
-
- !ruby/object:Gem::Dependency
|
86
|
-
name: jeweler
|
87
57
|
prerelease: false
|
88
|
-
|
58
|
+
version_requirements: *70172354939220
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: jeweler
|
61
|
+
requirement: &70172354938740 !ruby/object:Gem::Requirement
|
89
62
|
none: false
|
90
|
-
requirements:
|
63
|
+
requirements:
|
91
64
|
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
hash: 7
|
94
|
-
segments:
|
95
|
-
- 1
|
96
|
-
- 6
|
97
|
-
- 4
|
65
|
+
- !ruby/object:Gem::Version
|
98
66
|
version: 1.6.4
|
99
67
|
type: :development
|
100
|
-
version_requirements: *id005
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: rake
|
103
68
|
prerelease: false
|
104
|
-
|
69
|
+
version_requirements: *70172354938740
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rake
|
72
|
+
requirement: &70172354954620 !ruby/object:Gem::Requirement
|
105
73
|
none: false
|
106
|
-
requirements:
|
74
|
+
requirements:
|
107
75
|
- - ~>
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
hash: 63
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
- 9
|
113
|
-
- 2
|
76
|
+
- !ruby/object:Gem::Version
|
114
77
|
version: 0.9.2
|
115
78
|
type: :development
|
116
|
-
version_requirements: *id006
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: rspec
|
119
79
|
prerelease: false
|
120
|
-
|
80
|
+
version_requirements: *70172354954620
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rspec
|
83
|
+
requirement: &70172354954140 !ruby/object:Gem::Requirement
|
121
84
|
none: false
|
122
|
-
requirements:
|
85
|
+
requirements:
|
123
86
|
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
hash: 31
|
126
|
-
segments:
|
127
|
-
- 1
|
128
|
-
- 3
|
129
|
-
- 2
|
87
|
+
- !ruby/object:Gem::Version
|
130
88
|
version: 1.3.2
|
131
89
|
type: :development
|
132
|
-
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *70172354954140
|
133
92
|
description: Integrate DataMapper with Rails 3
|
134
93
|
email: gamsnjaga@gmail.com
|
135
94
|
executables: []
|
136
|
-
|
137
95
|
extensions: []
|
138
|
-
|
139
|
-
extra_rdoc_files:
|
96
|
+
extra_rdoc_files:
|
140
97
|
- LICENSE
|
141
98
|
- README.rdoc
|
142
|
-
files:
|
99
|
+
files:
|
143
100
|
- .document
|
144
101
|
- Gemfile
|
145
102
|
- LICENSE
|
@@ -179,36 +136,26 @@ files:
|
|
179
136
|
- tasks/yardstick.rake
|
180
137
|
homepage: http://github.com/datamapper/dm-rails
|
181
138
|
licenses: []
|
182
|
-
|
183
139
|
post_install_message:
|
184
140
|
rdoc_options: []
|
185
|
-
|
186
|
-
require_paths:
|
141
|
+
require_paths:
|
187
142
|
- lib
|
188
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
189
144
|
none: false
|
190
|
-
requirements:
|
191
|
-
- -
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
|
194
|
-
|
195
|
-
- 0
|
196
|
-
version: "0"
|
197
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ! '>='
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
150
|
none: false
|
199
|
-
requirements:
|
200
|
-
- -
|
201
|
-
- !ruby/object:Gem::Version
|
202
|
-
|
203
|
-
segments:
|
204
|
-
- 0
|
205
|
-
version: "0"
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
206
155
|
requirements: []
|
207
|
-
|
208
156
|
rubyforge_project: datamapper
|
209
157
|
rubygems_version: 1.8.11
|
210
158
|
signing_key:
|
211
159
|
specification_version: 3
|
212
160
|
summary: Use DataMapper with Rails 3
|
213
161
|
test_files: []
|
214
|
-
|