active_attr 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of active_attr might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +3 -3
- data/Guardfile +1 -1
- data/README.md +1 -1
- data/active_attr.gemspec +2 -2
- data/gemfiles/rails_3_0.gemfile +1 -1
- data/gemfiles/rails_3_1.gemfile +5 -1
- data/gemfiles/rails_3_2.gemfile +4 -0
- data/gemfiles/rails_4_1.gemfile +8 -0
- data/gemfiles/rails_head.gemfile +1 -1
- data/lib/active_attr/attribute_defaults.rb +1 -1
- data/lib/active_attr/version.rb +1 -1
- data/spec/functional/active_attr/attribute_defaults_spec.rb +5 -5
- data/spec/functional/active_attr/mass_assignment_spec.rb +2 -2
- data/spec/support/active_model_lint.rb +12 -5
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bb7e53f2054586e55a4525ae90cb876f9547a80
|
4
|
+
data.tar.gz: 4b974df36856198c997f7c4d4cc1f69de62324a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 319453d2ec1608a29f1d2c4d76f24bc6339bb9e53def143aa73eb6af41d5732a36eb03c6d390d43a7200c7e9202f11146009dab765178f27a169c8d7e7a8a750
|
7
|
+
data.tar.gz: 4014a7911ae766cf7f37dc4df20a36404e45ddd4a83a641914aca6c0cd6054626ae1a1b36f7dd7e1c55d5b70fbf344cd2624ae92b7f5b0989596d09f9e56189f
|
data/.travis.yml
CHANGED
@@ -11,6 +11,7 @@ gemfile:
|
|
11
11
|
- gemfiles/rails_3_1.gemfile
|
12
12
|
- gemfiles/rails_3_2.gemfile
|
13
13
|
- gemfiles/rails_4_0.gemfile
|
14
|
+
- gemfiles/rails_4_1.gemfile
|
14
15
|
- Gemfile
|
15
16
|
- gemfiles/rails_head.gemfile
|
16
17
|
matrix:
|
@@ -21,6 +22,10 @@ matrix:
|
|
21
22
|
gemfile: gemfiles/rails_4_0.gemfile
|
22
23
|
- rvm: 1.9.2
|
23
24
|
gemfile: gemfiles/rails_4_0.gemfile
|
25
|
+
- rvm: ree
|
26
|
+
gemfile: gemfiles/rails_4_1.gemfile
|
27
|
+
- rvm: 1.9.2
|
28
|
+
gemfile: gemfiles/rails_4_1.gemfile
|
24
29
|
- rvm: ree
|
25
30
|
gemfile: Gemfile
|
26
31
|
- rvm: 1.9.2
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -2,9 +2,9 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec :development_group => :test
|
4
4
|
|
5
|
-
gem "activemodel", "~> 4.
|
6
|
-
gem "activesupport", "~> 4.
|
7
|
-
gem "actionpack", "~> 4.
|
5
|
+
gem "activemodel", "~> 4.2.0"
|
6
|
+
gem "activesupport", "~> 4.2.0"
|
7
|
+
gem "actionpack", "~> 4.2.0", :group => :test
|
8
8
|
gem "protected_attributes", :group => :test
|
9
9
|
|
10
10
|
group :development do
|
data/Guardfile
CHANGED
@@ -3,7 +3,7 @@ guard "bundler" do
|
|
3
3
|
watch(/^.+\.gemspec/)
|
4
4
|
end
|
5
5
|
|
6
|
-
guard "rspec"
|
6
|
+
guard "rspec" do
|
7
7
|
watch(%r{^spec/.+_spec\.rb$})
|
8
8
|
watch(%r{^lib/(.+)\.rb$}) { |m| ["spec/unit/#{m[1]}_spec.rb", "spec/functional/#{m[1]}_spec.rb"] }
|
9
9
|
watch("spec/spec_helper.rb") { "spec" }
|
data/README.md
CHANGED
@@ -198,7 +198,7 @@ protected attributes, including support for mass assignment roles.
|
|
198
198
|
person.first_name #=> "Chris"
|
199
199
|
person.last_name #=> nil
|
200
200
|
|
201
|
-
If using the [Strong
|
201
|
+
If using the [Strong Parameters gem][strong_parameters] with Rails 3.2,
|
202
202
|
include the forbidden attributes protection module after including
|
203
203
|
the mass assignment security module.
|
204
204
|
|
data/active_attr.gemspec
CHANGED
@@ -15,8 +15,8 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = ActiveAttr::VERSION
|
17
17
|
|
18
|
-
gem.add_runtime_dependency "activemodel", ">= 3.0.2", "<
|
19
|
-
gem.add_runtime_dependency "activesupport", ">= 3.0.2", "<
|
18
|
+
gem.add_runtime_dependency "activemodel", ">= 3.0.2", "< 5.0"
|
19
|
+
gem.add_runtime_dependency "activesupport", ">= 3.0.2", "< 5.0"
|
20
20
|
|
21
21
|
gem.add_development_dependency "bundler", "~> 1.0"
|
22
22
|
gem.add_development_dependency "factory_girl", ">= 2.2", "< 5.0"
|
data/gemfiles/rails_3_0.gemfile
CHANGED
data/gemfiles/rails_3_1.gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source "
|
1
|
+
source "https://rubygems.org"
|
2
2
|
|
3
3
|
gemspec :development_group => :test, :path => ".."
|
4
4
|
|
@@ -6,5 +6,9 @@ if RUBY_VERSION < "1.9.2"
|
|
6
6
|
gem "factory_girl", "< 3.0", :group => :test
|
7
7
|
end
|
8
8
|
|
9
|
+
if RUBY_VERSION < "1.9.3"
|
10
|
+
gem "i18n", "< 0.7"
|
11
|
+
end
|
12
|
+
|
9
13
|
gem "activemodel", "~> 3.1.0"
|
10
14
|
gem "activesupport", "~> 3.1.0"
|
data/gemfiles/rails_3_2.gemfile
CHANGED
@@ -6,6 +6,10 @@ if RUBY_VERSION < "1.9.2"
|
|
6
6
|
gem "factory_girl", "< 3.0", :group => :test
|
7
7
|
end
|
8
8
|
|
9
|
+
if RUBY_VERSION < "1.9.3"
|
10
|
+
gem "i18n", "< 0.7"
|
11
|
+
end
|
12
|
+
|
9
13
|
gem "activemodel", "~> 3.2.0"
|
10
14
|
gem "activesupport", "~> 3.2.0"
|
11
15
|
gem "strong_parameters", ">= 0.2.0", :group => :test
|
data/gemfiles/rails_head.gemfile
CHANGED
data/lib/active_attr/version.rb
CHANGED
@@ -11,7 +11,7 @@ module ActiveAttr
|
|
11
11
|
let :model_class do
|
12
12
|
Class.new.tap do |model_class|
|
13
13
|
model_class.class_eval do
|
14
|
-
include
|
14
|
+
include AttributeDefaults
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -93,8 +93,8 @@ module ActiveAttr
|
|
93
93
|
context "combined with MassAssignment" do
|
94
94
|
let :model_class do
|
95
95
|
Class.new do
|
96
|
-
include
|
97
|
-
include
|
96
|
+
include MassAssignment
|
97
|
+
include AttributeDefaults
|
98
98
|
|
99
99
|
attribute :start_date
|
100
100
|
attribute :end_date, :default => lambda { start_date }
|
@@ -126,8 +126,8 @@ module ActiveAttr
|
|
126
126
|
context "combined with TypecastedAttributes" do
|
127
127
|
let :model_class do
|
128
128
|
Class.new do
|
129
|
-
include
|
130
|
-
include
|
129
|
+
include TypecastedAttributes
|
130
|
+
include AttributeDefaults
|
131
131
|
|
132
132
|
attribute :age, :type => Integer, :default => "21"
|
133
133
|
attribute :start_date, :type => String, :default => lambda { Date.today }
|
@@ -75,7 +75,7 @@ module ActiveAttr
|
|
75
75
|
require "strong_parameters"
|
76
76
|
|
77
77
|
model_class.class_eval do
|
78
|
-
include
|
78
|
+
include MassAssignment
|
79
79
|
include ActiveModel::MassAssignmentSecurity
|
80
80
|
include ActiveModel::ForbiddenAttributesProtection
|
81
81
|
attr_accessor :age
|
@@ -84,7 +84,7 @@ module ActiveAttr
|
|
84
84
|
require "action_controller"
|
85
85
|
|
86
86
|
model_class.class_eval do
|
87
|
-
include
|
87
|
+
include MassAssignment
|
88
88
|
include ActiveModel::MassAssignmentSecurity
|
89
89
|
include ActiveModel::ForbiddenAttributesProtection
|
90
90
|
attr_accessor :age
|
@@ -1,13 +1,20 @@
|
|
1
1
|
require "active_model/lint"
|
2
|
-
require "test/unit/assertions"
|
3
2
|
|
4
3
|
shared_examples_for "ActiveModel" do
|
5
4
|
include ActiveModel::Lint::Tests
|
6
|
-
include Test::Unit::Assertions
|
7
|
-
attr_writer :assertions
|
8
5
|
|
9
|
-
|
10
|
-
|
6
|
+
begin
|
7
|
+
require "minitest/assertions"
|
8
|
+
include Minitest::Assertions
|
9
|
+
|
10
|
+
attr_writer :assertions
|
11
|
+
|
12
|
+
def assertions
|
13
|
+
@assertions ||= 0
|
14
|
+
end
|
15
|
+
rescue LoadError
|
16
|
+
require "test/unit/assertions"
|
17
|
+
include Test::Unit::Assertions
|
11
18
|
end
|
12
19
|
|
13
20
|
before { @model = subject }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_attr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Griego
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: 3.0.2
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '5.0'
|
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: '5.0'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: activesupport
|
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: '5.0'
|
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: '5.0'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: bundler
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- gemfiles/rails_3_1.gemfile
|
158
158
|
- gemfiles/rails_3_2.gemfile
|
159
159
|
- gemfiles/rails_4_0.gemfile
|
160
|
+
- gemfiles/rails_4_1.gemfile
|
160
161
|
- gemfiles/rails_head.gemfile
|
161
162
|
- lib/active_attr.rb
|
162
163
|
- lib/active_attr/attribute_defaults.rb
|
@@ -249,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
250
|
version: '0'
|
250
251
|
requirements: []
|
251
252
|
rubyforge_project:
|
252
|
-
rubygems_version: 2.
|
253
|
+
rubygems_version: 2.4.2
|
253
254
|
signing_key:
|
254
255
|
specification_version: 4
|
255
256
|
summary: What ActiveModel left out
|