protected_attributes 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15c93e40990d4d4312dbe484bbbc6cb598e2d442
|
4
|
+
data.tar.gz: f1a5f94afb7fc4a9a7de9579e656108608b9799d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a04423b815ce4e3a34849ced63a114dec9a905063b0d7b49dc3ae6c1cb353851ae4c2d32b98147d9a4295f98292e9ebd562330e331095635840a5c300c5524b
|
7
|
+
data.tar.gz: 892034d899c89aaf1ae211cd078f4b90e03d38618f8a5a449e4e45509cd902672d634d1896cf62207a3a364785836d9fbd93bf6352891422202ec90dcc6288db
|
@@ -12,8 +12,11 @@ module ActiveRecord
|
|
12
12
|
def subclass_from_attributes?(attrs)
|
13
13
|
active_authorizer[:default].deny?(inheritance_column) ? nil : super
|
14
14
|
end
|
15
|
+
|
15
16
|
# Support Active Record <= 4.0.3, which uses the old method signature.
|
16
|
-
|
17
|
+
def subclass_from_attrs(attrs)
|
18
|
+
active_authorizer[:default].deny?(inheritance_column) ? nil : super
|
19
|
+
end
|
17
20
|
end
|
18
21
|
end
|
19
22
|
end
|
@@ -597,32 +597,32 @@ class MassAssignmentSecurityHasManyRelationsTest < ActiveSupport::TestCase
|
|
597
597
|
|
598
598
|
# new
|
599
599
|
|
600
|
-
def
|
600
|
+
def test_has_many_new_with_attr_protected_attributes
|
601
601
|
best_friend = @person.best_friends.new(attributes_hash)
|
602
602
|
assert_default_attributes(best_friend)
|
603
603
|
end
|
604
604
|
|
605
|
-
def
|
605
|
+
def test_has_many_new_with_attr_accessible_attributes
|
606
606
|
best_friend = @person.best_friends.new(attributes_hash)
|
607
607
|
assert_default_attributes(best_friend)
|
608
608
|
end
|
609
609
|
|
610
|
-
def
|
610
|
+
def test_has_many_new_with_admin_role_with_attr_protected_attributes
|
611
611
|
best_friend = @person.best_friends.new(attributes_hash, :as => :admin)
|
612
612
|
assert_admin_attributes(best_friend)
|
613
613
|
end
|
614
614
|
|
615
|
-
def
|
615
|
+
def test_has_many_new_with_admin_role_with_attr_accessible_attributes
|
616
616
|
best_friend = @person.best_friends.new(attributes_hash, :as => :admin)
|
617
617
|
assert_admin_attributes(best_friend)
|
618
618
|
end
|
619
619
|
|
620
|
-
def
|
620
|
+
def test_has_many_new_without_protection
|
621
621
|
best_friend = @person.best_friends.new(attributes_hash, :without_protection => true)
|
622
622
|
assert_all_attributes(best_friend)
|
623
623
|
end
|
624
624
|
|
625
|
-
def
|
625
|
+
def test_has_many_new_with_strict_sanitizer
|
626
626
|
with_strict_sanitizer do
|
627
627
|
best_friend = @person.best_friends.new(attributes_hash.except(:id, :comments))
|
628
628
|
assert_equal @person.id, best_friend.best_friend_id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protected_attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|