safe_attributes 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +9 -3
- data/VERSION +1 -1
- data/safe_attributes.gemspec +12 -12
- data/spec/safe_attributes/safe_attributes_spec.rb +8 -0
- metadata +160 -157
data/Gemfile
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
# Kind of hacky, supposed to be cleaner with bundler 1.1 later
|
4
|
+
if ENV.has_key?('SA_WITH_3_0')
|
5
|
+
gem 'activesupport', '~> 3.0.0'
|
6
|
+
gem 'activerecord', '~> 3.0.0'
|
7
|
+
else
|
8
|
+
gem 'activesupport', '>= 3.0.0'
|
9
|
+
gem 'activerecord', '>= 3.0.0'
|
10
|
+
end
|
5
11
|
|
6
12
|
group :development do
|
7
13
|
gem 'jeweler', '>= 1.5.2'
|
@@ -10,7 +16,7 @@ group :development do
|
|
10
16
|
gem 'rspec', '>= 2.3.0'
|
11
17
|
gem 'rcov'
|
12
18
|
platform :ruby do
|
13
|
-
gem 'sqlite3
|
19
|
+
gem 'sqlite3', '>= 1.3.4'
|
14
20
|
end
|
15
21
|
platform :jruby do
|
16
22
|
gem 'activerecord-jdbcsqlite3-adapter'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.6
|
data/safe_attributes.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{safe_attributes}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian Jones"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-09-25}
|
13
13
|
s.description = %q{Better support for legacy database schemas for ActiveRecord, such as columns named class, or any other name that conflicts with an instance method of ActiveRecord.}
|
14
14
|
s.email = %q{cbj@gnu.org}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -34,44 +34,44 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.homepage = %q{http://github.com/bjones/safe_attributes}
|
35
35
|
s.licenses = ["MIT"]
|
36
36
|
s.require_paths = ["lib"]
|
37
|
-
s.rubygems_version = %q{1.
|
37
|
+
s.rubygems_version = %q{1.5.1}
|
38
38
|
s.summary = %q{Useful for legacy database support, adds support for reserved word column names with ActiveRecord}
|
39
39
|
|
40
40
|
if s.respond_to? :specification_version then
|
41
41
|
s.specification_version = 3
|
42
42
|
|
43
43
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
|
-
s.add_runtime_dependency(%q<activesupport>, ["
|
45
|
-
s.add_runtime_dependency(%q<activerecord>, ["
|
44
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
|
45
|
+
s.add_runtime_dependency(%q<activerecord>, [">= 3.0.0"])
|
46
46
|
s.add_development_dependency(%q<jeweler>, [">= 1.5.2"])
|
47
47
|
s.add_development_dependency(%q<rake>, [">= 0.8.7"])
|
48
48
|
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
49
49
|
s.add_development_dependency(%q<rspec>, [">= 2.3.0"])
|
50
50
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
51
|
-
s.add_development_dependency(%q<sqlite3
|
51
|
+
s.add_development_dependency(%q<sqlite3>, [">= 1.3.4"])
|
52
52
|
s.add_development_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
|
53
53
|
s.add_development_dependency(%q<jruby-openssl>, [">= 0"])
|
54
54
|
else
|
55
|
-
s.add_dependency(%q<activesupport>, ["
|
56
|
-
s.add_dependency(%q<activerecord>, ["
|
55
|
+
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
56
|
+
s.add_dependency(%q<activerecord>, [">= 3.0.0"])
|
57
57
|
s.add_dependency(%q<jeweler>, [">= 1.5.2"])
|
58
58
|
s.add_dependency(%q<rake>, [">= 0.8.7"])
|
59
59
|
s.add_dependency(%q<rdoc>, [">= 0"])
|
60
60
|
s.add_dependency(%q<rspec>, [">= 2.3.0"])
|
61
61
|
s.add_dependency(%q<rcov>, [">= 0"])
|
62
|
-
s.add_dependency(%q<sqlite3
|
62
|
+
s.add_dependency(%q<sqlite3>, [">= 1.3.4"])
|
63
63
|
s.add_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
|
64
64
|
s.add_dependency(%q<jruby-openssl>, [">= 0"])
|
65
65
|
end
|
66
66
|
else
|
67
|
-
s.add_dependency(%q<activesupport>, ["
|
68
|
-
s.add_dependency(%q<activerecord>, ["
|
67
|
+
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
68
|
+
s.add_dependency(%q<activerecord>, [">= 3.0.0"])
|
69
69
|
s.add_dependency(%q<jeweler>, [">= 1.5.2"])
|
70
70
|
s.add_dependency(%q<rake>, [">= 0.8.7"])
|
71
71
|
s.add_dependency(%q<rdoc>, [">= 0"])
|
72
72
|
s.add_dependency(%q<rspec>, [">= 2.3.0"])
|
73
73
|
s.add_dependency(%q<rcov>, [">= 0"])
|
74
|
-
s.add_dependency(%q<sqlite3
|
74
|
+
s.add_dependency(%q<sqlite3>, [">= 1.3.4"])
|
75
75
|
s.add_dependency(%q<activerecord-jdbcsqlite3-adapter>, [">= 0"])
|
76
76
|
s.add_dependency(%q<jruby-openssl>, [">= 0"])
|
77
77
|
end
|
@@ -10,6 +10,8 @@ ActiveRecord::Base.connection.create_table(:my_models) do |t|
|
|
10
10
|
t.string :changed
|
11
11
|
# bad because normally it generates DangerousAttributeError
|
12
12
|
t.string :errors
|
13
|
+
# support hyphenated column names
|
14
|
+
t.string :"comment-frequency"
|
13
15
|
end
|
14
16
|
|
15
17
|
class MyModel < ActiveRecord::Base
|
@@ -91,6 +93,12 @@ describe MyModel do
|
|
91
93
|
m[:errors].should == 'my errors'
|
92
94
|
end
|
93
95
|
|
96
|
+
it "can create instance in database with attribute 'comment-frequency'" do
|
97
|
+
m = MyModel.create!(:class => 'Foo', :"comment-frequency" => 'often')
|
98
|
+
m = MyModel.find(m.id)
|
99
|
+
m[:"comment-frequency"].should == 'often'
|
100
|
+
end
|
101
|
+
|
94
102
|
it "has class attribute" do
|
95
103
|
MyModel.new().has_attribute?('class').should be_true
|
96
104
|
end
|
metadata
CHANGED
@@ -1,178 +1,181 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: safe_attributes
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.5
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
5
|
+
version: 1.0.6
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
- Brian Jones
|
7
|
+
authors:
|
8
|
+
- Brian Jones
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
12
|
+
|
13
|
+
date: 2011-09-25 00:00:00 -04:00
|
13
14
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
- !ruby/object:Gem::Dependency
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
description: Better support for legacy database schemas for ActiveRecord, such as
|
126
|
-
columns named class, or any other name that conflicts with an instance method of
|
127
|
-
ActiveRecord.
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: activesupport
|
18
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 3.0.0
|
24
|
+
requirement: *id001
|
25
|
+
prerelease: false
|
26
|
+
type: :runtime
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activerecord
|
29
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 3.0.0
|
35
|
+
requirement: *id002
|
36
|
+
prerelease: false
|
37
|
+
type: :runtime
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: jeweler
|
40
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.5.2
|
46
|
+
requirement: *id003
|
47
|
+
prerelease: false
|
48
|
+
type: :development
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rake
|
51
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.8.7
|
57
|
+
requirement: *id004
|
58
|
+
prerelease: false
|
59
|
+
type: :development
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: rdoc
|
62
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "0"
|
68
|
+
requirement: *id005
|
69
|
+
prerelease: false
|
70
|
+
type: :development
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rspec
|
73
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 2.3.0
|
79
|
+
requirement: *id006
|
80
|
+
prerelease: false
|
81
|
+
type: :development
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rcov
|
84
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: "0"
|
90
|
+
requirement: *id007
|
91
|
+
prerelease: false
|
92
|
+
type: :development
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: sqlite3
|
95
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 1.3.4
|
101
|
+
requirement: *id008
|
102
|
+
prerelease: false
|
103
|
+
type: :development
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: activerecord-jdbcsqlite3-adapter
|
106
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: "0"
|
112
|
+
requirement: *id009
|
113
|
+
prerelease: false
|
114
|
+
type: :development
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: jruby-openssl
|
117
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: "0"
|
123
|
+
requirement: *id010
|
124
|
+
prerelease: false
|
125
|
+
type: :development
|
126
|
+
description: Better support for legacy database schemas for ActiveRecord, such as columns named class, or any other name that conflicts with an instance method of ActiveRecord.
|
128
127
|
email: cbj@gnu.org
|
129
128
|
executables: []
|
129
|
+
|
130
130
|
extensions: []
|
131
|
-
|
132
|
-
|
133
|
-
-
|
134
|
-
|
135
|
-
|
136
|
-
- .
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
- lib/safe_attributes
|
145
|
-
- safe_attributes.
|
146
|
-
-
|
147
|
-
- spec/
|
131
|
+
|
132
|
+
extra_rdoc_files:
|
133
|
+
- LICENSE
|
134
|
+
- README.rdoc
|
135
|
+
files:
|
136
|
+
- .document
|
137
|
+
- .rspec
|
138
|
+
- Gemfile
|
139
|
+
- LICENSE
|
140
|
+
- NEWS.rdoc
|
141
|
+
- README.rdoc
|
142
|
+
- Rakefile
|
143
|
+
- VERSION
|
144
|
+
- lib/safe_attributes.rb
|
145
|
+
- lib/safe_attributes/railtie.rb
|
146
|
+
- safe_attributes.gemspec
|
147
|
+
- spec/safe_attributes/safe_attributes_spec.rb
|
148
|
+
- spec/spec_helper.rb
|
148
149
|
has_rdoc: true
|
149
150
|
homepage: http://github.com/bjones/safe_attributes
|
150
|
-
licenses:
|
151
|
-
- MIT
|
151
|
+
licenses:
|
152
|
+
- MIT
|
152
153
|
post_install_message:
|
153
154
|
rdoc_options: []
|
154
|
-
|
155
|
-
|
156
|
-
|
155
|
+
|
156
|
+
require_paths:
|
157
|
+
- lib
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
159
|
none: false
|
158
|
-
requirements:
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
hash: 2
|
164
|
+
segments:
|
165
|
+
- 0
|
166
|
+
version: "0"
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
168
|
none: false
|
167
|
-
requirements:
|
168
|
-
|
169
|
-
|
170
|
-
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: "0"
|
171
173
|
requirements: []
|
174
|
+
|
172
175
|
rubyforge_project:
|
173
|
-
rubygems_version: 1.
|
176
|
+
rubygems_version: 1.5.1
|
174
177
|
signing_key:
|
175
178
|
specification_version: 3
|
176
|
-
summary: Useful for legacy database support, adds support for reserved word column
|
177
|
-
names with ActiveRecord
|
179
|
+
summary: Useful for legacy database support, adds support for reserved word column names with ActiveRecord
|
178
180
|
test_files: []
|
181
|
+
|