protected_attributes 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8372becd26526e1fc2393017c348c0afbc925251
4
- data.tar.gz: bb435cfca8a3a8d9fbd12a2c237772f5a7d2192e
3
+ metadata.gz: 15c93e40990d4d4312dbe484bbbc6cb598e2d442
4
+ data.tar.gz: f1a5f94afb7fc4a9a7de9579e656108608b9799d
5
5
  SHA512:
6
- metadata.gz: 4092b1f39b4215557653dc7700c832d59096b2d7acdf0a11f28875546df551f1b49343aa9ac926ff9d7cbb64b57a3092d5e699ebcc58dbf9d9e5996b50bdaed1
7
- data.tar.gz: a74183be7e1d3730845c3a3b8b1685ba0f524575ef5fb833929674805c41575612aa1be91867256606f5492a399ed5e98f16a93f5c64c584685b9a72528a8af4
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
- alias_method :subclass_from_attrs, :subclass_from_attributes?
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
@@ -1,3 +1,3 @@
1
1
  module ProtectedAttributes
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
@@ -597,32 +597,32 @@ class MassAssignmentSecurityHasManyRelationsTest < ActiveSupport::TestCase
597
597
 
598
598
  # new
599
599
 
600
- def test_has_many_build_with_attr_protected_attributes
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 test_has_many_build_with_attr_accessible_attributes
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 test_has_many_build_with_admin_role_with_attr_protected_attributes
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 test_has_many_build_with_admin_role_with_attr_accessible_attributes
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 test_has_many_build_without_protection
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 test_has_many_build_with_strict_sanitizer
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.6
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-10 00:00:00.000000000 Z
11
+ date: 2014-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel