active_attr 0.15.0 → 0.15.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yaml +203 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile +5 -6
- data/README.md +3 -3
- data/active_attr.gemspec +7 -7
- data/gemfiles/rails_3_1.gemfile +1 -4
- data/gemfiles/rails_3_2.gemfile +1 -8
- data/gemfiles/rails_5_0.gemfile +1 -0
- data/gemfiles/rails_5_1.gemfile +1 -0
- data/gemfiles/rails_5_2.gemfile +1 -0
- data/gemfiles/rails_6_0.gemfile +10 -0
- data/gemfiles/rails_6_1.gemfile +10 -0
- data/gemfiles/rails_head.gemfile +2 -1
- data/lib/active_attr/typecasting/boolean_typecaster.rb +1 -1
- data/lib/active_attr/version.rb +1 -1
- data/spec/functional/active_attr/attributes_spec.rb +0 -32
- data/spec/functional/active_attr/mass_assignment_spec.rb +2 -2
- metadata +26 -24
- data/.travis.yml +0 -95
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c15f00f2cfc6c6ffdfd40c5ceb03c5f352b035e48b64f8b94ba021eafebf47f9
|
4
|
+
data.tar.gz: '09cb76b33a15ccd8db66d1ce1d82c194eb78a9272ff3dfbda9463fd691514a02'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c76b578e6b83c4fd79bc6c3db708a724f8b8d258ea376022da7fced32449ed07b428bbcc8c06cb5783fde3b6533dc827af75185afeaa19214daf7e33ba36dbe
|
7
|
+
data.tar.gz: c65dd72971455398ca158bd99403dea24ac14d5de945b1d45b7250fcaad21c07b90128ae6cec0f764ccd1306c20f02eb427e9ced66c7f295e2260abd08a0944d
|
@@ -0,0 +1,203 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
name: Ruby ${{ matrix.ruby }} with ${{ matrix.gemfile }}
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
continue-on-error: ${{ contains(matrix.ruby, 'head') || contains(matrix.gemfile, 'head') }}
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
ruby:
|
18
|
+
- 2.1.9
|
19
|
+
- 2.2.10
|
20
|
+
- 2.3.8
|
21
|
+
- 2.4.10
|
22
|
+
- 2.5.9
|
23
|
+
- 2.6.8
|
24
|
+
- 2.7.4
|
25
|
+
- 3.0.2
|
26
|
+
- truffleruby-head
|
27
|
+
gemfile:
|
28
|
+
- gemfiles/rails_3_0.gemfile
|
29
|
+
- gemfiles/rails_3_1.gemfile
|
30
|
+
- gemfiles/rails_3_2.gemfile
|
31
|
+
- gemfiles/rails_4_0.gemfile
|
32
|
+
- gemfiles/rails_4_1.gemfile
|
33
|
+
- gemfiles/rails_4_2.gemfile
|
34
|
+
- gemfiles/rails_5_0.gemfile
|
35
|
+
- gemfiles/rails_5_1.gemfile
|
36
|
+
- gemfiles/rails_5_2.gemfile
|
37
|
+
- gemfiles/rails_6_0.gemfile
|
38
|
+
- gemfiles/rails_6_1.gemfile
|
39
|
+
- Gemfile
|
40
|
+
- gemfiles/rails_head.gemfile
|
41
|
+
exclude:
|
42
|
+
- ruby: 1.9.2
|
43
|
+
gemfile: gemfiles/rails_4_0.gemfile
|
44
|
+
- ruby: 1.9.2
|
45
|
+
gemfile: gemfiles/rails_4_1.gemfile
|
46
|
+
- ruby: 1.9.2
|
47
|
+
gemfile: gemfiles/rails_4_2.gemfile
|
48
|
+
- ruby: 1.9.2
|
49
|
+
gemfile: gemfiles/rails_5_0.gemfile
|
50
|
+
- ruby: 1.9.2
|
51
|
+
gemfile: gemfiles/rails_5_1.gemfile
|
52
|
+
- ruby: 1.9.2
|
53
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
54
|
+
- ruby: 1.9.2
|
55
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
56
|
+
- ruby: 1.9.2
|
57
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
58
|
+
- ruby: 1.9.2
|
59
|
+
gemfile: Gemfile
|
60
|
+
- ruby: 1.9.2
|
61
|
+
gemfile: gemfiles/rails_head.gemfile
|
62
|
+
- ruby: 1.9.3
|
63
|
+
gemfile: gemfiles/rails_5_0.gemfile
|
64
|
+
- ruby: 1.9.3
|
65
|
+
gemfile: gemfiles/rails_5_1.gemfile
|
66
|
+
- ruby: 1.9.3
|
67
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
68
|
+
- ruby: 1.9.3
|
69
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
70
|
+
- ruby: 1.9.3
|
71
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
72
|
+
- ruby: 1.9.3
|
73
|
+
gemfile: Gemfile
|
74
|
+
- ruby: 1.9.3
|
75
|
+
gemfile: gemfiles/rails_head.gemfile
|
76
|
+
- ruby: 2.0.0
|
77
|
+
gemfile: gemfiles/rails_5_0.gemfile
|
78
|
+
- ruby: 2.0.0
|
79
|
+
gemfile: gemfiles/rails_5_1.gemfile
|
80
|
+
- ruby: 2.0.0
|
81
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
82
|
+
- ruby: 2.0.0
|
83
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
84
|
+
- ruby: 2.0.0
|
85
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
86
|
+
- ruby: 2.0.0
|
87
|
+
gemfile: Gemfile
|
88
|
+
- ruby: 2.0.0
|
89
|
+
gemfile: gemfiles/rails_head.gemfile
|
90
|
+
- ruby: 2.1.9
|
91
|
+
gemfile: gemfiles/rails_5_0.gemfile
|
92
|
+
- ruby: 2.1.9
|
93
|
+
gemfile: gemfiles/rails_5_1.gemfile
|
94
|
+
- ruby: 2.1.9
|
95
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
96
|
+
- ruby: 2.1.9
|
97
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
98
|
+
- ruby: 2.1.9
|
99
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
100
|
+
- ruby: 2.1.9
|
101
|
+
gemfile: Gemfile
|
102
|
+
- ruby: 2.1.9
|
103
|
+
gemfile: gemfiles/rails_head.gemfile
|
104
|
+
- ruby: 2.2.10
|
105
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
106
|
+
- ruby: 2.2.10
|
107
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
108
|
+
- ruby: 2.2.10
|
109
|
+
gemfile: Gemfile
|
110
|
+
- ruby: 2.2.10
|
111
|
+
gemfile: gemfiles/rails_head.gemfile
|
112
|
+
- ruby: 2.3.8
|
113
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
114
|
+
- ruby: 2.3.8
|
115
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
116
|
+
- ruby: 2.3.8
|
117
|
+
gemfile: Gemfile
|
118
|
+
- ruby: 2.3.8
|
119
|
+
gemfile: gemfiles/rails_head.gemfile
|
120
|
+
- ruby: 2.4.10
|
121
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
122
|
+
- ruby: 2.4.10
|
123
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
124
|
+
- ruby: 2.4.10
|
125
|
+
gemfile: Gemfile
|
126
|
+
- ruby: 2.4.10
|
127
|
+
gemfile: gemfiles/rails_head.gemfile
|
128
|
+
- ruby: 2.5.9
|
129
|
+
gemfile: gemfiles/rails_3_0.gemfile
|
130
|
+
- ruby: 2.5.9
|
131
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
132
|
+
- ruby: 2.5.9
|
133
|
+
gemfile: Gemfile
|
134
|
+
- ruby: 2.5.9
|
135
|
+
gemfile: gemfiles/rails_head.gemfile
|
136
|
+
- ruby: 2.6.8
|
137
|
+
gemfile: gemfiles/rails_3_0.gemfile
|
138
|
+
- ruby: 2.6.8
|
139
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
140
|
+
- ruby: 2.6.8
|
141
|
+
gemfile: Gemfile
|
142
|
+
- ruby: 2.6.8
|
143
|
+
gemfile: gemfiles/rails_head.gemfile
|
144
|
+
- ruby: 2.7.4
|
145
|
+
gemfile: gemfiles/rails_3_0.gemfile
|
146
|
+
- ruby: 2.7.4
|
147
|
+
gemfile: gemfiles/rails_3_1.gemfile
|
148
|
+
- ruby: 2.7.4
|
149
|
+
gemfile: gemfiles/rails_3_2.gemfile
|
150
|
+
- ruby: 2.7.4
|
151
|
+
gemfile: gemfiles/rails_4_0.gemfile
|
152
|
+
- ruby: 2.7.4
|
153
|
+
gemfile: gemfiles/rails_4_1.gemfile
|
154
|
+
- ruby: 2.7.4
|
155
|
+
gemfile: gemfiles/rails_4_2.gemfile
|
156
|
+
- ruby: 3.0.2
|
157
|
+
gemfile: gemfiles/rails_3_0.gemfile
|
158
|
+
- ruby: 3.0.2
|
159
|
+
gemfile: gemfiles/rails_3_1.gemfile
|
160
|
+
- ruby: 3.0.2
|
161
|
+
gemfile: gemfiles/rails_3_2.gemfile
|
162
|
+
- ruby: 3.0.2
|
163
|
+
gemfile: gemfiles/rails_4_0.gemfile
|
164
|
+
- ruby: 3.0.2
|
165
|
+
gemfile: gemfiles/rails_4_1.gemfile
|
166
|
+
- ruby: 3.0.2
|
167
|
+
gemfile: gemfiles/rails_4_2.gemfile
|
168
|
+
- ruby: 3.0.2
|
169
|
+
gemfile: gemfiles/rails_5_0.gemfile
|
170
|
+
- ruby: 3.0.2
|
171
|
+
gemfile: gemfiles/rails_5_1.gemfile
|
172
|
+
- ruby: 3.0.2
|
173
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
174
|
+
- ruby: truffleruby-head
|
175
|
+
gemfile: gemfiles/rails_3_0.gemfile
|
176
|
+
- ruby: truffleruby-head
|
177
|
+
gemfile: gemfiles/rails_3_1.gemfile
|
178
|
+
- ruby: truffleruby-head
|
179
|
+
gemfile: gemfiles/rails_3_2.gemfile
|
180
|
+
- ruby: truffleruby-head
|
181
|
+
gemfile: gemfiles/rails_4_0.gemfile
|
182
|
+
- ruby: truffleruby-head
|
183
|
+
gemfile: gemfiles/rails_4_1.gemfile
|
184
|
+
- ruby: truffleruby-head
|
185
|
+
gemfile: gemfiles/rails_4_2.gemfile
|
186
|
+
env:
|
187
|
+
Rails: ${{ matrix.rails }}
|
188
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
189
|
+
|
190
|
+
steps:
|
191
|
+
- name: Checkout code
|
192
|
+
uses: actions/checkout@master
|
193
|
+
- name: Nokogiri support for TruffleRuby
|
194
|
+
run: sudo apt-get -yqq install libxml2-dev libxslt-dev
|
195
|
+
if: ${{ matrix.ruby == 'truffleruby-head' }}
|
196
|
+
- name: Set up Ruby
|
197
|
+
uses: ruby/setup-ruby@v1
|
198
|
+
with:
|
199
|
+
ruby-version: ${{ matrix.ruby }}
|
200
|
+
bundler: 1
|
201
|
+
bundler-cache: true
|
202
|
+
- name: Run tests
|
203
|
+
run: bundle exec rake --trace
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# ActiveAttr 0.15.3 (December 16, 2021)
|
2
|
+
|
3
|
+
* ActiveAttr now supports Rails 7.0 (Steve Hoeksema)
|
4
|
+
|
5
|
+
# ActiveAttr 0.15.3 (April 12, 2021)
|
6
|
+
|
7
|
+
* #185 Fixed ReDoS vulnerability in BooleanTypecaster#call (ねず)
|
8
|
+
|
9
|
+
# ActiveAttr 0.15.2 (February 17, 2021)
|
10
|
+
|
11
|
+
* ActiveAttr now supports Ruby 3.0
|
12
|
+
* Allow unreleased versions of Rails 7.0
|
13
|
+
|
14
|
+
# ActiveAttr 0.15.1 (December 11, 2020) #
|
15
|
+
|
16
|
+
* ActiveAttr now supports Ruby 2.7
|
17
|
+
* ActiveAttr now supports Rails 6.1
|
18
|
+
* Drop support for Ruby versions below 2.1
|
19
|
+
|
1
20
|
# ActiveAttr 0.15.0 (June 12, 2019) #
|
2
21
|
|
3
22
|
* Add missing ActiveSupport require for Attributes
|
data/Gemfile
CHANGED
@@ -2,15 +2,15 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec :development_group => :test
|
4
4
|
|
5
|
-
gem "activemodel", "
|
6
|
-
gem "activesupport", "
|
7
|
-
gem "actionpack", "
|
5
|
+
gem "activemodel", "~> 7.0.0"
|
6
|
+
gem "activesupport", "~> 7.0.0"
|
7
|
+
gem "actionpack", "~> 7.0.0"
|
8
8
|
gem "activemodel-serializers-xml", :group => :test
|
9
|
+
gem "rexml", :group => :test
|
9
10
|
gem "protected_attributes_continued", :group => :test
|
10
11
|
|
11
12
|
group :development do
|
12
|
-
gem "
|
13
|
-
gem "byebug" unless RUBY_VERSION < "2.0"
|
13
|
+
gem "byebug"
|
14
14
|
gem "growl"
|
15
15
|
gem "guard"
|
16
16
|
gem "guard-bundler"
|
@@ -19,6 +19,5 @@ group :development do
|
|
19
19
|
gem "rdiscount"
|
20
20
|
gem "rdoc"
|
21
21
|
gem "spec_coverage", :git => "https://github.com/getaroom/spec_coverage.git"
|
22
|
-
gem "travis"
|
23
22
|
gem "yard"
|
24
23
|
end
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ActiveAttr #
|
2
2
|
|
3
|
-
[![Build History][
|
3
|
+
[![Build History][build badge]][build history]
|
4
4
|
[![Code Climate][codeclimate badge]][codeclimate]
|
5
5
|
|
6
6
|
ActiveAttr is a set of modules that makes it easy to create plain old Ruby
|
@@ -26,8 +26,8 @@ ActiveAttr is distributed as a Ruby gem [on rubygems.org][rubygems].
|
|
26
26
|
[protected_attributes]: https://github.com/westonganger/protected_attributes_continued
|
27
27
|
[strong_parameters]: https://github.com/rails/strong_parameters
|
28
28
|
[speakerdeck]: https://speakerdeck.com/u/cgriego/p/models-models-every-where
|
29
|
-
[
|
30
|
-
[
|
29
|
+
[build badge]: https://github.com/cgriego/active_attr/workflows/Test/badge.svg?event=push
|
30
|
+
[build history]: https://github.com/cgriego/active_attr/actions?query=workflow%3ATest
|
31
31
|
|
32
32
|
## Modules ##
|
33
33
|
|
data/active_attr.gemspec
CHANGED
@@ -20,16 +20,16 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.require_paths = ["lib"]
|
21
21
|
gem.version = ActiveAttr::VERSION
|
22
22
|
|
23
|
-
gem.required_ruby_version = ">= 1.
|
23
|
+
gem.required_ruby_version = ">= 2.1.0"
|
24
24
|
|
25
|
-
gem.add_runtime_dependency "actionpack", ">= 3.0.2", "<
|
26
|
-
gem.add_runtime_dependency "activemodel", ">= 3.0.2", "<
|
27
|
-
gem.add_runtime_dependency "activesupport", ">= 3.0.2", "<
|
25
|
+
gem.add_runtime_dependency "actionpack", ">= 3.0.2", "< 7.1"
|
26
|
+
gem.add_runtime_dependency "activemodel", ">= 3.0.2", "< 7.1"
|
27
|
+
gem.add_runtime_dependency "activesupport", ">= 3.0.2", "< 7.1"
|
28
28
|
|
29
|
-
gem.add_development_dependency "bundler"
|
29
|
+
gem.add_development_dependency "bundler"
|
30
30
|
gem.add_development_dependency "factory_bot", "< 5.0"
|
31
31
|
gem.add_development_dependency "minitest"
|
32
|
-
gem.add_development_dependency "rake", ">= 0.9.0", "<
|
32
|
+
gem.add_development_dependency "rake", ">= 0.9.0", "< 13.1"
|
33
33
|
gem.add_development_dependency "rspec", "~> 3.0"
|
34
|
-
gem.add_development_dependency "tzinfo"
|
34
|
+
gem.add_development_dependency "tzinfo"
|
35
35
|
end
|
data/gemfiles/rails_3_1.gemfile
CHANGED
data/gemfiles/rails_3_2.gemfile
CHANGED
@@ -2,14 +2,7 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec :development_group => :test, :path => ".."
|
4
4
|
|
5
|
-
if RUBY_VERSION < "1.9.3"
|
6
|
-
gem "i18n", "< 0.7"
|
7
|
-
end
|
8
|
-
|
9
|
-
if RUBY_VERSION < "1.9.3"
|
10
|
-
gem "rack-cache", "< 1.3", :group => :test
|
11
|
-
end
|
12
|
-
|
13
5
|
gem "activemodel", "~> 3.2.0"
|
14
6
|
gem "activesupport", "~> 3.2.0"
|
15
7
|
gem "strong_parameters", ">= 0.2.0", :group => :test
|
8
|
+
gem "tzinfo", "< 2"
|
data/gemfiles/rails_5_0.gemfile
CHANGED
data/gemfiles/rails_5_1.gemfile
CHANGED
data/gemfiles/rails_5_2.gemfile
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec :development_group => :test, :path => ".."
|
4
|
+
|
5
|
+
gem "activemodel", "~> 6.0.0"
|
6
|
+
gem "activesupport", "~> 6.0.0"
|
7
|
+
gem "actionpack", "~> 6.0.0"
|
8
|
+
gem "activemodel-serializers-xml", :group => :test
|
9
|
+
gem "rexml", :group => :test
|
10
|
+
gem "protected_attributes_continued", :group => :test
|
@@ -0,0 +1,10 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec :development_group => :test, :path => ".."
|
4
|
+
|
5
|
+
gem "activemodel", "~> 6.1.0"
|
6
|
+
gem "activesupport", "~> 6.1.0"
|
7
|
+
gem "actionpack", "~> 6.1.0"
|
8
|
+
gem "activemodel-serializers-xml", :group => :test
|
9
|
+
gem "rexml", :group => :test
|
10
|
+
gem "protected_attributes_continued", :group => :test
|
data/gemfiles/rails_head.gemfile
CHANGED
@@ -2,12 +2,13 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec :development_group => :test, :path => ".."
|
4
4
|
|
5
|
-
git "git://github.com/rails/rails.git" do
|
5
|
+
git "git://github.com/rails/rails.git", :branch => "main" do
|
6
6
|
gem "activemodel"
|
7
7
|
gem "activesupport"
|
8
8
|
gem "actionpack"
|
9
9
|
end
|
10
10
|
|
11
11
|
gem "activemodel-serializers-xml", :group => :test, :git => "git://github.com/rails/activemodel-serializers-xml.git"
|
12
|
+
gem "rexml", :group => :test
|
12
13
|
gem "protected_attributes_continued", :group => :test, :git => "git://github.com/westonganger/protected_attributes_continued"
|
13
14
|
gem "rack", :group => :test, :git => "git://github.com/rack/rack.git"
|
@@ -42,7 +42,7 @@ module ActiveAttr
|
|
42
42
|
case value
|
43
43
|
when *FALSE_VALUES then false
|
44
44
|
when *NIL_VALUES then nil
|
45
|
-
when Numeric, /\A[-+]?(0
|
45
|
+
when Numeric, /\A[-+]?(0++\.?0*|0*+\.?0+)\z/ then !value.to_f.zero?
|
46
46
|
else value.present?
|
47
47
|
end
|
48
48
|
end
|
data/lib/active_attr/version.rb
CHANGED
@@ -201,28 +201,6 @@ module ActiveAttr
|
|
201
201
|
end
|
202
202
|
end
|
203
203
|
|
204
|
-
shared_examples "a whitelisted attribute" do
|
205
|
-
it ".dangerous_attribute? is falsey" do
|
206
|
-
model_class.dangerous_attribute?(attribute_name).should be_falsey
|
207
|
-
end
|
208
|
-
|
209
|
-
it ".attribute does not raise" do
|
210
|
-
expect { model_class.attribute(attribute_name) }.not_to raise_error
|
211
|
-
end
|
212
|
-
|
213
|
-
it ".attribute! does not raise" do
|
214
|
-
expect { model_class.attribute!(attribute_name) }.not_to raise_error
|
215
|
-
end
|
216
|
-
|
217
|
-
it "can be set and get" do
|
218
|
-
model_class.attribute attribute_name
|
219
|
-
model = model_class.new
|
220
|
-
value = double
|
221
|
-
model.send "#{attribute_name}=", value
|
222
|
-
model.send(attribute_name).should equal value
|
223
|
-
end
|
224
|
-
end
|
225
|
-
|
226
204
|
shared_examples "defining dangerous attributes" do
|
227
205
|
context "an attribute that conflicts with #{described_class}" do
|
228
206
|
let(:attribute_name) { :write_attribute }
|
@@ -258,16 +236,6 @@ module ActiveAttr
|
|
258
236
|
let(:attribute_name) { :my_less_proper_missing_method }
|
259
237
|
include_examples "a dangerous attribute"
|
260
238
|
end
|
261
|
-
|
262
|
-
context "an :id attribute" do
|
263
|
-
let(:attribute_name) { :id }
|
264
|
-
include_examples "a whitelisted attribute"
|
265
|
-
end
|
266
|
-
|
267
|
-
context "a :type attribute" do
|
268
|
-
let(:attribute_name) { :type }
|
269
|
-
include_examples "a whitelisted attribute"
|
270
|
-
end
|
271
239
|
end
|
272
240
|
|
273
241
|
let :dangerous_model_class do
|
@@ -40,7 +40,7 @@ module ActiveAttr
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
context "
|
43
|
+
context "allowing attributes" do
|
44
44
|
before do
|
45
45
|
model_class.class_eval do
|
46
46
|
attr_accessible :first_name, :last_name, :name
|
@@ -53,7 +53,7 @@ module ActiveAttr
|
|
53
53
|
describe "#initialize", :initialize, :secure_mass_assignment_method, :secure_mass_assignment_method_with_options
|
54
54
|
end
|
55
55
|
|
56
|
-
context "
|
56
|
+
context "denying attributes" do
|
57
57
|
before do
|
58
58
|
model_class.class_eval do
|
59
59
|
attr_protected :age
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_attr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Griego
|
8
8
|
- Ben Poweski
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: 3.0.2
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '7.1'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: 3.0.2
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '7.1'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: activemodel
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version: 3.0.2
|
41
41
|
- - "<"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '
|
43
|
+
version: '7.1'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
version: 3.0.2
|
51
51
|
- - "<"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '7.1'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: activesupport
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
version: 3.0.2
|
61
61
|
- - "<"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '
|
63
|
+
version: '7.1'
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -70,21 +70,21 @@ dependencies:
|
|
70
70
|
version: 3.0.2
|
71
71
|
- - "<"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
73
|
+
version: '7.1'
|
74
74
|
- !ruby/object:Gem::Dependency
|
75
75
|
name: bundler
|
76
76
|
requirement: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- - "
|
78
|
+
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
80
|
+
version: '0'
|
81
81
|
type: :development
|
82
82
|
prerelease: false
|
83
83
|
version_requirements: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- - "
|
85
|
+
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
87
|
+
version: '0'
|
88
88
|
- !ruby/object:Gem::Dependency
|
89
89
|
name: factory_bot
|
90
90
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
version: 0.9.0
|
123
123
|
- - "<"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '
|
125
|
+
version: '13.1'
|
126
126
|
type: :development
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -132,7 +132,7 @@ dependencies:
|
|
132
132
|
version: 0.9.0
|
133
133
|
- - "<"
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: '
|
135
|
+
version: '13.1'
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
name: rspec
|
138
138
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,16 +151,16 @@ dependencies:
|
|
151
151
|
name: tzinfo
|
152
152
|
requirement: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- - "
|
154
|
+
- - ">="
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
version: '
|
156
|
+
version: '0'
|
157
157
|
type: :development
|
158
158
|
prerelease: false
|
159
159
|
version_requirements: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
|
-
- - "
|
161
|
+
- - ">="
|
162
162
|
- !ruby/object:Gem::Version
|
163
|
-
version: '
|
163
|
+
version: '0'
|
164
164
|
description: Create plain old Ruby models without reinventing the wheel.
|
165
165
|
email:
|
166
166
|
- cgriego@gmail.com
|
@@ -169,9 +169,9 @@ executables: []
|
|
169
169
|
extensions: []
|
170
170
|
extra_rdoc_files: []
|
171
171
|
files:
|
172
|
+
- ".github/workflows/test.yaml"
|
172
173
|
- ".gitignore"
|
173
174
|
- ".rspec"
|
174
|
-
- ".travis.yml"
|
175
175
|
- ".yardopts"
|
176
176
|
- CHANGELOG.md
|
177
177
|
- Gemfile
|
@@ -189,6 +189,8 @@ files:
|
|
189
189
|
- gemfiles/rails_5_0.gemfile
|
190
190
|
- gemfiles/rails_5_1.gemfile
|
191
191
|
- gemfiles/rails_5_2.gemfile
|
192
|
+
- gemfiles/rails_6_0.gemfile
|
193
|
+
- gemfiles/rails_6_1.gemfile
|
192
194
|
- gemfiles/rails_head.gemfile
|
193
195
|
- lib/active_attr.rb
|
194
196
|
- lib/active_attr/attribute_defaults.rb
|
@@ -267,7 +269,7 @@ licenses:
|
|
267
269
|
- MIT
|
268
270
|
metadata:
|
269
271
|
changelog_uri: https://github.com/cgriego/active_attr/blob/master/CHANGELOG.md
|
270
|
-
post_install_message:
|
272
|
+
post_install_message:
|
271
273
|
rdoc_options: []
|
272
274
|
require_paths:
|
273
275
|
- lib
|
@@ -275,15 +277,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
275
277
|
requirements:
|
276
278
|
- - ">="
|
277
279
|
- !ruby/object:Gem::Version
|
278
|
-
version: 1.
|
280
|
+
version: 2.1.0
|
279
281
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
282
|
requirements:
|
281
283
|
- - ">="
|
282
284
|
- !ruby/object:Gem::Version
|
283
285
|
version: '0'
|
284
286
|
requirements: []
|
285
|
-
rubygems_version: 3.
|
286
|
-
signing_key:
|
287
|
+
rubygems_version: 3.1.2
|
288
|
+
signing_key:
|
287
289
|
specification_version: 4
|
288
290
|
summary: What ActiveModel left out
|
289
291
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: trusty # for Ruby 1.9
|
3
|
-
sudo: false
|
4
|
-
rvm:
|
5
|
-
- 1.9.2
|
6
|
-
- 1.9.3
|
7
|
-
- 2.0.0
|
8
|
-
- 2.1.10
|
9
|
-
- 2.2.10
|
10
|
-
- 2.3.8
|
11
|
-
- 2.4.6
|
12
|
-
- 2.5.5
|
13
|
-
- 2.6.3
|
14
|
-
before_install:
|
15
|
-
- travis_retry gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
|
16
|
-
- travis_retry gem install bundler -v '< 2'
|
17
|
-
bundler_args: --without development
|
18
|
-
gemfile:
|
19
|
-
- gemfiles/rails_3_0.gemfile
|
20
|
-
- gemfiles/rails_3_1.gemfile
|
21
|
-
- gemfiles/rails_3_2.gemfile
|
22
|
-
- gemfiles/rails_4_0.gemfile
|
23
|
-
- gemfiles/rails_4_1.gemfile
|
24
|
-
- gemfiles/rails_4_2.gemfile
|
25
|
-
- gemfiles/rails_5_0.gemfile
|
26
|
-
- gemfiles/rails_5_1.gemfile
|
27
|
-
- gemfiles/rails_5_2.gemfile
|
28
|
-
- Gemfile
|
29
|
-
- gemfiles/rails_head.gemfile
|
30
|
-
matrix:
|
31
|
-
allow_failures:
|
32
|
-
- gemfile: gemfiles/rails_head.gemfile
|
33
|
-
exclude:
|
34
|
-
- rvm: 2.5.5
|
35
|
-
gemfile: gemfiles/rails_3_0.gemfile
|
36
|
-
- rvm: 2.6.3
|
37
|
-
gemfile: gemfiles/rails_3_0.gemfile
|
38
|
-
- rvm: 1.9.2
|
39
|
-
gemfile: gemfiles/rails_4_0.gemfile
|
40
|
-
- rvm: 1.9.2
|
41
|
-
gemfile: gemfiles/rails_4_1.gemfile
|
42
|
-
- rvm: 1.9.2
|
43
|
-
gemfile: gemfiles/rails_4_2.gemfile
|
44
|
-
- rvm: 1.9.2
|
45
|
-
gemfile: gemfiles/rails_5_0.gemfile
|
46
|
-
- rvm: 1.9.3
|
47
|
-
gemfile: gemfiles/rails_5_0.gemfile
|
48
|
-
- rvm: 2.0.0
|
49
|
-
gemfile: gemfiles/rails_5_0.gemfile
|
50
|
-
- rvm: 2.1.10
|
51
|
-
gemfile: gemfiles/rails_5_0.gemfile
|
52
|
-
- rvm: 1.9.2
|
53
|
-
gemfile: gemfiles/rails_5_1.gemfile
|
54
|
-
- rvm: 1.9.3
|
55
|
-
gemfile: gemfiles/rails_5_1.gemfile
|
56
|
-
- rvm: 2.0.0
|
57
|
-
gemfile: gemfiles/rails_5_1.gemfile
|
58
|
-
- rvm: 2.1.10
|
59
|
-
gemfile: gemfiles/rails_5_1.gemfile
|
60
|
-
- rvm: 1.9.2
|
61
|
-
gemfile: gemfiles/rails_5_2.gemfile
|
62
|
-
- rvm: 1.9.3
|
63
|
-
gemfile: gemfiles/rails_5_2.gemfile
|
64
|
-
- rvm: 2.0.0
|
65
|
-
gemfile: gemfiles/rails_5_2.gemfile
|
66
|
-
- rvm: 2.1.10
|
67
|
-
gemfile: gemfiles/rails_5_2.gemfile
|
68
|
-
- rvm: 1.9.2
|
69
|
-
gemfile: Gemfile
|
70
|
-
- rvm: 1.9.3
|
71
|
-
gemfile: Gemfile
|
72
|
-
- rvm: 2.0.0
|
73
|
-
gemfile: Gemfile
|
74
|
-
- rvm: 2.1.10
|
75
|
-
gemfile: Gemfile
|
76
|
-
- rvm: 2.2.10
|
77
|
-
gemfile: Gemfile
|
78
|
-
- rvm: 2.3.8
|
79
|
-
gemfile: Gemfile
|
80
|
-
- rvm: 2.4.6
|
81
|
-
gemfile: Gemfile
|
82
|
-
- rvm: 1.9.2
|
83
|
-
gemfile: gemfiles/rails_head.gemfile
|
84
|
-
- rvm: 1.9.3
|
85
|
-
gemfile: gemfiles/rails_head.gemfile
|
86
|
-
- rvm: 2.0.0
|
87
|
-
gemfile: gemfiles/rails_head.gemfile
|
88
|
-
- rvm: 2.1.10
|
89
|
-
gemfile: gemfiles/rails_head.gemfile
|
90
|
-
- rvm: 2.2.10
|
91
|
-
gemfile: gemfiles/rails_head.gemfile
|
92
|
-
- rvm: 2.3.8
|
93
|
-
gemfile: gemfiles/rails_head.gemfile
|
94
|
-
- rvm: 2.4.6
|
95
|
-
gemfile: gemfiles/rails_head.gemfile
|