protected_attributes 1.0.5 → 1.0.6

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: d88c64a0975b2a5d3adaeac77a86a6788f27b3d4
4
- data.tar.gz: 184cfbc31f25454d8c4d1e3b69cb9bbc1afdb67e
3
+ metadata.gz: 8372becd26526e1fc2393017c348c0afbc925251
4
+ data.tar.gz: bb435cfca8a3a8d9fbd12a2c237772f5a7d2192e
5
5
  SHA512:
6
- metadata.gz: 719bc98721e881fa2d2c38100c27520e4f3248958ef26cf49ba34e5b2f207fe0e6e77f943e7fd0a377708cbe5a6ca54957af5e8e949f54d041d6a853d08fc95f
7
- data.tar.gz: 5a052c0eb01c13eb311272150280e187f448dbad757b26e60cb91230db55ff7148bd7c906b1c0675942c807d2abf6bc8ab629ad295091ea131e619fabfc69664
6
+ metadata.gz: 4092b1f39b4215557653dc7700c832d59096b2d7acdf0a11f28875546df551f1b49343aa9ac926ff9d7cbb64b57a3092d5e699ebcc58dbf9d9e5996b50bdaed1
7
+ data.tar.gz: a74183be7e1d3730845c3a3b8b1685ba0f524575ef5fb833929674805c41575612aa1be91867256606f5492a399ed5e98f16a93f5c64c584685b9a72528a8af4
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ProtectedAttributes
2
2
 
3
+ [![Build Status](https://travis-ci.org/rails/protected_attributes.png)](https://travis-ci.org/rails/protected_attributes)
4
+
3
5
  Protect attributes from mass-assignment in ActiveRecord models.
4
6
 
5
7
  This plugin adds `attr_accessible` and `attr_protected` in your models.
@@ -1,4 +1,9 @@
1
1
  require "active_record"
2
+
3
+ def active_record_40?
4
+ ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR == 0
5
+ end
6
+
2
7
  require "active_record/mass_assignment_security/associations"
3
8
  require "active_record/mass_assignment_security/attribute_assignment"
4
9
  require "active_record/mass_assignment_security/core"
@@ -54,6 +54,7 @@ module ActiveRecord
54
54
  def build(attributes = {}, options = {}, &block)
55
55
  @association.build(attributes, options, &block)
56
56
  end
57
+ alias_method :new, :build
57
58
 
58
59
  def create(attributes = {}, options = {}, &block)
59
60
  @association.create(attributes, options, &block)
@@ -9,10 +9,12 @@ module ActiveRecord
9
9
  # is not self or a valid subclass, raises ActiveRecord::SubclassNotFound
10
10
  # If this is a StrongParameters hash, and access to inheritance_column is not permitted,
11
11
  # this will ignore the inheritance column and return nil
12
- def subclass_from_attrs(attrs)
12
+ def subclass_from_attributes?(attrs)
13
13
  active_authorizer[:default].deny?(inheritance_column) ? nil : super
14
14
  end
15
+ # Support Active Record <= 4.0.3, which uses the old method signature.
16
+ alias_method :subclass_from_attrs, :subclass_from_attributes?
15
17
  end
16
18
  end
17
19
  end
18
- end
20
+ end
@@ -24,10 +24,12 @@ module ActiveRecord
24
24
 
25
25
  type = (reflection.collection? ? :collection : :one_to_one)
26
26
 
27
+ generated_methods_module = active_record_40? ? generated_feature_methods : generated_association_methods
28
+
27
29
  # def pirate_attributes=(attributes)
28
30
  # assign_nested_attributes_for_one_to_one_association(:pirate, attributes, mass_assignment_options)
29
31
  # end
30
- generated_feature_methods.module_eval <<-eoruby, __FILE__, __LINE__ + 1
32
+ generated_methods_module.module_eval <<-eoruby, __FILE__, __LINE__ + 1
31
33
  if method_defined?(:#{association_name}_attributes=)
32
34
  remove_method(:#{association_name}_attributes=)
33
35
  end
@@ -1,3 +1,3 @@
1
1
  module ProtectedAttributes
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
@@ -1,8 +1,17 @@
1
1
  require 'action_dispatch'
2
2
  require 'action_controller'
3
- require 'active_support/core_ext/class/attribute_accessors'
4
3
  require 'active_support/dependencies'
5
4
 
5
+ def active_support_4_0?
6
+ ActiveSupport::VERSION::MAJOR == 4 && ActiveSupport::VERSION::MINOR == 0
7
+ end
8
+
9
+ if active_support_4_0?
10
+ require 'active_support/core_ext/class/attribute_accessors'
11
+ else
12
+ require 'active_support/core_ext/module/attribute_accessors'
13
+ end
14
+
6
15
  module SetupOnce
7
16
  extend ActiveSupport::Concern
8
17
 
data/test/ar_helper.rb CHANGED
@@ -1,9 +1,5 @@
1
1
  require 'active_record'
2
2
 
3
- ActiveSupport::Deprecation.silence do
4
- require 'active_record/test_case'
5
- end
6
-
7
3
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
8
4
 
9
5
  ActiveRecord::Schema.verbose = false
@@ -244,25 +244,29 @@ class AttributeSanitizationTest < ActiveSupport::TestCase
244
244
  end
245
245
 
246
246
  def test_protection_against_class_attribute_writers
247
- [:logger, :configurations, :primary_key_prefix_type, :table_name_prefix, :table_name_suffix, :pluralize_table_names,
247
+ attribute_writers = [:logger, :configurations, :primary_key_prefix_type, :table_name_prefix, :table_name_suffix, :pluralize_table_names,
248
248
  :default_timezone, :schema_format, :lock_optimistically, :timestamped_migrations, :default_scopes,
249
- :connection_handler, :nested_attributes_options, :_attr_readonly, :attribute_types_cached_by_default,
250
- :attribute_method_matchers, :time_zone_aware_attributes, :skip_time_zone_conversion_for_attributes].each do |method|
251
- assert_respond_to Task, method
252
- assert_respond_to Task, "#{method}="
253
- assert_respond_to Task.new, method
249
+ :connection_handler, :nested_attributes_options, :attribute_types_cached_by_default,
250
+ :attribute_method_matchers, :time_zone_aware_attributes, :skip_time_zone_conversion_for_attributes]
251
+
252
+ attribute_writers.push(:_attr_readonly) if active_record_40?
253
+
254
+ attribute_writers.each do |method|
255
+ assert_respond_to Task, method
256
+ assert_respond_to Task, "#{method}="
257
+ assert_respond_to Task.new, method unless method == :configurations && !active_record_40?
254
258
  assert !Task.new.respond_to?("#{method}=")
255
259
  end
256
260
  end
257
261
 
258
262
  def test_new_with_protected_inheritance_column
259
263
  firm = Company.new(type: "Firm")
260
- assert_equal firm.class, Company
264
+ assert_equal Company, firm.class
261
265
  end
262
266
 
263
267
  def test_new_with_accessible_inheritance_column
264
268
  corporation = Corporation.new(type: "SpecialCorporation")
265
- assert_equal corporation.class, SpecialCorporation
269
+ assert_equal SpecialCorporation, corporation.class
266
270
  end
267
271
 
268
272
  def test_new_with_invalid_inheritance_column_class
@@ -275,74 +279,74 @@ class AttributeSanitizationTest < ActiveSupport::TestCase
275
279
  end
276
280
 
277
281
 
278
- # This class should be deleted when we remove activerecord-deprecated_finders as a
279
- # dependency.
280
- class MassAssignmentSecurityDeprecatedFindersTest < ActiveRecord::TestCase
281
- include MassAssignmentTestHelpers
282
+ if active_record_40?
283
+ # This class should be deleted when we remove activerecord-deprecated_finders as a
284
+ # dependency.
285
+ class MassAssignmentSecurityDeprecatedFindersTest < ActiveSupport::TestCase
286
+ include MassAssignmentTestHelpers
282
287
 
283
- def setup
284
- super
285
- @deprecation_behavior = ActiveSupport::Deprecation.behavior
286
- ActiveSupport::Deprecation.behavior = :silence
287
- end
288
+ def setup
289
+ super
290
+ @deprecation_behavior = ActiveSupport::Deprecation.behavior
291
+ ActiveSupport::Deprecation.behavior = :silence
292
+ end
288
293
 
289
- def teardown
290
- super
291
- ActiveSupport::Deprecation.behavior = @deprecation_behavior
292
- end
294
+ def teardown
295
+ super
296
+ ActiveSupport::Deprecation.behavior = @deprecation_behavior
297
+ end
293
298
 
294
- def test_find_or_initialize_by_with_attr_accessible_attributes
295
- p = TightPerson.find_or_initialize_by_first_name('Josh', attributes_hash)
299
+ def test_find_or_initialize_by_with_attr_accessible_attributes
300
+ p = TightPerson.find_or_initialize_by_first_name('Josh', attributes_hash)
296
301
 
297
- assert_default_attributes(p)
298
- end
302
+ assert_default_attributes(p)
303
+ end
299
304
 
300
- def test_find_or_initialize_by_with_admin_role_with_attr_accessible_attributes
301
- p = TightPerson.find_or_initialize_by_first_name('Josh', attributes_hash, :as => :admin)
305
+ def test_find_or_initialize_by_with_admin_role_with_attr_accessible_attributes
306
+ p = TightPerson.find_or_initialize_by_first_name('Josh', attributes_hash, :as => :admin)
302
307
 
303
- assert_admin_attributes(p)
304
- end
308
+ assert_admin_attributes(p)
309
+ end
305
310
 
306
- def test_find_or_initialize_by_with_attr_protected_attributes
307
- p = LoosePerson.find_or_initialize_by_first_name('Josh', attributes_hash)
311
+ def test_find_or_initialize_by_with_attr_protected_attributes
312
+ p = LoosePerson.find_or_initialize_by_first_name('Josh', attributes_hash)
308
313
 
309
- assert_default_attributes(p)
310
- end
314
+ assert_default_attributes(p)
315
+ end
311
316
 
312
- def test_find_or_initialize_by_with_admin_role_with_attr_protected_attributes
313
- p = LoosePerson.find_or_initialize_by_first_name('Josh', attributes_hash, :as => :admin)
317
+ def test_find_or_initialize_by_with_admin_role_with_attr_protected_attributes
318
+ p = LoosePerson.find_or_initialize_by_first_name('Josh', attributes_hash, :as => :admin)
314
319
 
315
- assert_admin_attributes(p)
316
- end
320
+ assert_admin_attributes(p)
321
+ end
317
322
 
318
- def test_find_or_create_by_with_attr_accessible_attributes
319
- p = TightPerson.find_or_create_by_first_name('Josh', attributes_hash)
323
+ def test_find_or_create_by_with_attr_accessible_attributes
324
+ p = TightPerson.find_or_create_by_first_name('Josh', attributes_hash)
320
325
 
321
- assert_default_attributes(p, true)
322
- end
326
+ assert_default_attributes(p, true)
327
+ end
323
328
 
324
- def test_find_or_create_by_with_admin_role_with_attr_accessible_attributes
325
- p = TightPerson.find_or_create_by_first_name('Josh', attributes_hash, :as => :admin)
329
+ def test_find_or_create_by_with_admin_role_with_attr_accessible_attributes
330
+ p = TightPerson.find_or_create_by_first_name('Josh', attributes_hash, :as => :admin)
326
331
 
327
- assert_admin_attributes(p, true)
328
- end
332
+ assert_admin_attributes(p, true)
333
+ end
329
334
 
330
- def test_find_or_create_by_with_attr_protected_attributes
331
- p = LoosePerson.find_or_create_by_first_name('Josh', attributes_hash)
335
+ def test_find_or_create_by_with_attr_protected_attributes
336
+ p = LoosePerson.find_or_create_by_first_name('Josh', attributes_hash)
332
337
 
333
- assert_default_attributes(p, true)
334
- end
338
+ assert_default_attributes(p, true)
339
+ end
335
340
 
336
- def test_find_or_create_by_with_admin_role_with_attr_protected_attributes
337
- p = LoosePerson.find_or_create_by_first_name('Josh', attributes_hash, :as => :admin)
341
+ def test_find_or_create_by_with_admin_role_with_attr_protected_attributes
342
+ p = LoosePerson.find_or_create_by_first_name('Josh', attributes_hash, :as => :admin)
338
343
 
339
- assert_admin_attributes(p, true)
344
+ assert_admin_attributes(p, true)
345
+ end
340
346
  end
341
-
342
347
  end
343
348
 
344
-
345
- class MassAssignmentSecurityHasOneRelationsTest < ActiveRecord::TestCase
349
+ class MassAssignmentSecurityHasOneRelationsTest < ActiveSupport::TestCase
346
350
  include MassAssignmentTestHelpers
347
351
  include MassAssignmentRelationTestHelpers
348
352
 
@@ -451,7 +455,7 @@ class MassAssignmentSecurityHasOneRelationsTest < ActiveRecord::TestCase
451
455
  end
452
456
 
453
457
 
454
- class MassAssignmentSecurityBelongsToRelationsTest < ActiveRecord::TestCase
458
+ class MassAssignmentSecurityBelongsToRelationsTest < ActiveSupport::TestCase
455
459
  include MassAssignmentTestHelpers
456
460
  include MassAssignmentRelationTestHelpers
457
461
 
@@ -553,7 +557,7 @@ class MassAssignmentSecurityBelongsToRelationsTest < ActiveRecord::TestCase
553
557
  end
554
558
 
555
559
 
556
- class MassAssignmentSecurityHasManyRelationsTest < ActiveRecord::TestCase
560
+ class MassAssignmentSecurityHasManyRelationsTest < ActiveSupport::TestCase
557
561
  include MassAssignmentTestHelpers
558
562
  include MassAssignmentRelationTestHelpers
559
563
 
@@ -591,6 +595,40 @@ class MassAssignmentSecurityHasManyRelationsTest < ActiveRecord::TestCase
591
595
  end
592
596
  end
593
597
 
598
+ # new
599
+
600
+ def test_has_many_build_with_attr_protected_attributes
601
+ best_friend = @person.best_friends.new(attributes_hash)
602
+ assert_default_attributes(best_friend)
603
+ end
604
+
605
+ def test_has_many_build_with_attr_accessible_attributes
606
+ best_friend = @person.best_friends.new(attributes_hash)
607
+ assert_default_attributes(best_friend)
608
+ end
609
+
610
+ def test_has_many_build_with_admin_role_with_attr_protected_attributes
611
+ best_friend = @person.best_friends.new(attributes_hash, :as => :admin)
612
+ assert_admin_attributes(best_friend)
613
+ end
614
+
615
+ def test_has_many_build_with_admin_role_with_attr_accessible_attributes
616
+ best_friend = @person.best_friends.new(attributes_hash, :as => :admin)
617
+ assert_admin_attributes(best_friend)
618
+ end
619
+
620
+ def test_has_many_build_without_protection
621
+ best_friend = @person.best_friends.new(attributes_hash, :without_protection => true)
622
+ assert_all_attributes(best_friend)
623
+ end
624
+
625
+ def test_has_many_build_with_strict_sanitizer
626
+ with_strict_sanitizer do
627
+ best_friend = @person.best_friends.new(attributes_hash.except(:id, :comments))
628
+ assert_equal @person.id, best_friend.best_friend_id
629
+ end
630
+ end
631
+
594
632
  # create
595
633
 
596
634
  def test_has_many_create_with_attr_protected_attributes
@@ -662,7 +700,7 @@ class MassAssignmentSecurityHasManyRelationsTest < ActiveRecord::TestCase
662
700
  end
663
701
 
664
702
 
665
- class MassAssignmentSecurityNestedAttributesTest < ActiveRecord::TestCase
703
+ class MassAssignmentSecurityNestedAttributesTest < ActiveSupport::TestCase
666
704
  include MassAssignmentTestHelpers
667
705
 
668
706
  def nested_attributes_hash(association, collection = false, except = [:id])
@@ -925,5 +963,4 @@ class MassAssignmentSecurityNestedAttributesTest < ActiveRecord::TestCase
925
963
  assert_equal 'Josh', person.best_friend.first_name
926
964
  assert_equal 'f', person.best_friend.gender
927
965
  end
928
-
929
966
  end
@@ -1,4 +1,5 @@
1
- require "test_helper"
1
+ require 'test_helper'
2
+ require 'active_model/mass_assignment_security'
2
3
 
3
4
  class BlackListTest < ActiveModel::TestCase
4
5
 
@@ -1,4 +1,5 @@
1
- require "test_helper"
1
+ require 'test_helper'
2
+ require 'active_model/mass_assignment_security'
2
3
 
3
4
  class PermissionSetTest < ActiveModel::TestCase
4
5
 
@@ -1,4 +1,5 @@
1
- require "test_helper"
1
+ require 'test_helper'
2
+ require 'active_model/mass_assignment_security'
2
3
  require 'active_support/logger'
3
4
 
4
5
  class SanitizerTest < ActiveModel::TestCase
@@ -1,4 +1,5 @@
1
- require "test_helper"
1
+ require 'test_helper'
2
+ require 'active_model/mass_assignment_security'
2
3
 
3
4
  class WhiteListTest < ActiveModel::TestCase
4
5
 
@@ -24,13 +24,6 @@ class Company < AbstractCompany
24
24
  end
25
25
 
26
26
  class Firm < Company
27
- ActiveSupport::Deprecation.silence do
28
- has_many :clients, -> { order "id" }, :dependent => :destroy, :counter_sql =>
29
- "SELECT COUNT(*) FROM companies WHERE firm_id = 1 " +
30
- "AND (#{QUOTED_TYPE} = 'Client' OR #{QUOTED_TYPE} = 'SpecialClient' OR #{QUOTED_TYPE} = 'VerySpecialClient' )",
31
- :before_remove => :log_before_remove,
32
- :after_remove => :log_after_remove
33
- end
34
27
  has_many :unsorted_clients, :class_name => "Client"
35
28
  has_many :unsorted_clients_with_symbol, :class_name => :Client
36
29
  has_many :clients_sorted_desc, -> { order "id DESC" }, :class_name => "Client"
@@ -43,19 +36,28 @@ class Firm < Company
43
36
  has_many :clients_with_interpolated_conditions, ->(firm) { where "rating > #{firm.rating}" }, :class_name => "Client"
44
37
  has_many :clients_like_ms, -> { where("name = 'Microsoft'").order("id") }, :class_name => "Client"
45
38
  has_many :clients_like_ms_with_hash_conditions, -> { where(:name => 'Microsoft').order("id") }, :class_name => "Client"
46
- ActiveSupport::Deprecation.silence do
47
- has_many :clients_using_sql, :class_name => "Client", :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id}" }
48
- has_many :clients_using_counter_sql, :class_name => "Client",
49
- :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id} " },
50
- :counter_sql => proc { "SELECT COUNT(*) FROM companies WHERE client_of = #{id}" }
51
- has_many :clients_using_zero_counter_sql, :class_name => "Client",
52
- :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id}" },
53
- :counter_sql => proc { "SELECT 0 FROM companies WHERE client_of = #{id}" }
54
- has_many :no_clients_using_counter_sql, :class_name => "Client",
55
- :finder_sql => 'SELECT * FROM companies WHERE client_of = 1000',
56
- :counter_sql => 'SELECT COUNT(*) FROM companies WHERE client_of = 1000'
57
- has_many :clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=1'
39
+
40
+ if active_record_40?
41
+ ActiveSupport::Deprecation.silence do
42
+ has_many :clients, -> { order "id" }, :dependent => :destroy, :counter_sql =>
43
+ "SELECT COUNT(*) FROM companies WHERE firm_id = 1 " +
44
+ "AND (#{QUOTED_TYPE} = 'Client' OR #{QUOTED_TYPE} = 'SpecialClient' OR #{QUOTED_TYPE} = 'VerySpecialClient' )",
45
+ :before_remove => :log_before_remove,
46
+ :after_remove => :log_after_remove
47
+ has_many :clients_using_sql, :class_name => "Client", :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id}" }
48
+ has_many :clients_using_counter_sql, :class_name => "Client",
49
+ :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id} " },
50
+ :counter_sql => proc { "SELECT COUNT(*) FROM companies WHERE client_of = #{id}" }
51
+ has_many :clients_using_zero_counter_sql, :class_name => "Client",
52
+ :finder_sql => proc { "SELECT * FROM companies WHERE client_of = #{id}" },
53
+ :counter_sql => proc { "SELECT 0 FROM companies WHERE client_of = #{id}" }
54
+ has_many :no_clients_using_counter_sql, :class_name => "Client",
55
+ :finder_sql => 'SELECT * FROM companies WHERE client_of = 1000',
56
+ :counter_sql => 'SELECT COUNT(*) FROM companies WHERE client_of = 1000'
57
+ has_many :clients_using_finder_sql, :class_name => "Client", :finder_sql => 'SELECT * FROM companies WHERE 1=1'
58
+ end
58
59
  end
60
+
59
61
  has_many :plain_clients, :class_name => 'Client'
60
62
  has_many :readonly_clients, -> { readonly }, :class_name => 'Client'
61
63
  has_many :clients_using_primary_key, :class_name => 'Client',
metadata CHANGED
@@ -1,101 +1,101 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protected_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
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: 2013-11-01 00:00:00.000000000 Z
11
+ date: 2014-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.0.1
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 4.0.1
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activerecord
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: 4.0.1
40
- - - <
40
+ - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '5.0'
43
43
  type: :development
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: 4.0.1
50
- - - <
50
+ - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '5.0'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: actionpack
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - '>='
57
+ - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: 4.0.1
60
- - - <
60
+ - - "<"
61
61
  - !ruby/object:Gem::Version
62
62
  version: '5.0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: 4.0.1
70
- - - <
70
+ - - "<"
71
71
  - !ruby/object:Gem::Version
72
72
  version: '5.0'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: sqlite3
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - '>='
77
+ - - ">="
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  type: :development
81
81
  prerelease: false
82
82
  version_requirements: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - '>='
84
+ - - ">="
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: mocha
89
89
  requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - '>='
91
+ - - ">="
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  type: :development
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - '>='
98
+ - - ">="
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  description: Protect attributes from mass assignment
@@ -108,9 +108,10 @@ files:
108
108
  - LICENSE.txt
109
109
  - README.md
110
110
  - lib/action_controller/accessible_params_wrapper.rb
111
+ - lib/active_model/mass_assignment_security.rb
111
112
  - lib/active_model/mass_assignment_security/permission_set.rb
112
113
  - lib/active_model/mass_assignment_security/sanitizer.rb
113
- - lib/active_model/mass_assignment_security.rb
114
+ - lib/active_record/mass_assignment_security.rb
114
115
  - lib/active_record/mass_assignment_security/associations.rb
115
116
  - lib/active_record/mass_assignment_security/attribute_assignment.rb
116
117
  - lib/active_record/mass_assignment_security/core.rb
@@ -120,10 +121,9 @@ files:
120
121
  - lib/active_record/mass_assignment_security/reflection.rb
121
122
  - lib/active_record/mass_assignment_security/relation.rb
122
123
  - lib/active_record/mass_assignment_security/validations.rb
123
- - lib/active_record/mass_assignment_security.rb
124
+ - lib/protected_attributes.rb
124
125
  - lib/protected_attributes/railtie.rb
125
126
  - lib/protected_attributes/version.rb
126
- - lib/protected_attributes.rb
127
127
  - test/abstract_unit.rb
128
128
  - test/accessible_params_wrapper_test.rb
129
129
  - test/ar_helper.rb
@@ -150,17 +150,17 @@ require_paths:
150
150
  - lib
151
151
  required_ruby_version: !ruby/object:Gem::Requirement
152
152
  requirements:
153
- - - '>='
153
+ - - ">="
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - '>='
158
+ - - ">="
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
162
  rubyforge_project:
163
- rubygems_version: 2.0.3
163
+ rubygems_version: 2.2.2
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: Protect attributes from mass assignment in Active Record models