protobuf-activerecord 3.6.1 → 5.0.0.beta

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
  SHA256:
3
- metadata.gz: c25dac0d341a98ef1a2063256abf9d20b2752f58280dfe32bd45a4e273fec2d0
4
- data.tar.gz: 77d0019eb2a66d0938beb272b773354f1d4fe55faf0b1390c908a44092dd4937
3
+ metadata.gz: 2acd9d491e63a0b8b6a1ddc834b90869ba7f1caa1c9f242cb303e89e820a3720
4
+ data.tar.gz: 490a6ae78996e6396374bfdf49b71a529456b7259b4bceb4b440c33dd36c1960
5
5
  SHA512:
6
- metadata.gz: 0febfd5d96839e78688ad1b9700a07063f37a1b6f3f9f8e0e8d643a65541192f88d36c6fb8cd28b219539d9c3a02e67cf57f6e5bfc5f7e3846f9c5aff3b79c39
7
- data.tar.gz: b534f6c7b313dac85bf4002f425d29e3be14b027ddbba2ea4b8be7b9e0187bfe400b327593d961f7c6b73276e5a6ebd08163473236c1f811a2746881f764a5d8
6
+ metadata.gz: a2320ac458f103be8732e0b54f1b6b520542fa6804f1a1114a5af5285f1931996af21055afae7a5fa55c182ad4e1ca05572f6369a9b602dd4c7ea761d2acb7d5
7
+ data.tar.gz: 387cd10d385db8e437c48b6d9adb1a80c92748bfbaab5bd124b38fae30482b8489e0225d7e494282f0752843ce0353ac89e3c6aefc4c9d8c64cc6f753fec2f42
@@ -4,14 +4,6 @@ require "active_support/concern"
4
4
  require "heredity"
5
5
  require "protobuf"
6
6
 
7
- # To support Rails 4 apps that use Mass-Assignment Security, attempt to
8
- # load the protected_attributes gem. If it's not present, move along...
9
- begin
10
- require "protected_attributes"
11
- rescue LoadError # rubocop:disable Lint/HandleExceptions
12
- # These aren't the droids you're looking for... move along.
13
- end
14
-
15
7
  require "protobuf/active_record/config"
16
8
  require "protobuf/active_record/middleware/connection_management"
17
9
  require "protobuf/active_record/middleware/connection_management_async"
@@ -1,7 +1,6 @@
1
1
  require "protobuf/active_record/attribute_methods"
2
2
  require "protobuf/active_record/columns"
3
3
  require "protobuf/active_record/errors"
4
- require "protobuf/active_record/mass_assignment_security"
5
4
  require "protobuf/active_record/nested_attributes"
6
5
  require "protobuf/active_record/persistence"
7
6
  require "protobuf/active_record/scope"
@@ -18,16 +17,11 @@ module Protobuf
18
17
  include Protobuf::ActiveRecord::AttributeMethods
19
18
  include Protobuf::ActiveRecord::Columns
20
19
  include Protobuf::ActiveRecord::NestedAttributes
20
+ include Protobuf::ActiveRecord::Persistence
21
21
  include Protobuf::ActiveRecord::Serialization
22
22
  include Protobuf::ActiveRecord::Scope
23
23
  include Protobuf::ActiveRecord::Transformation
24
24
  include Protobuf::ActiveRecord::Validations
25
-
26
- if defined?(::ActiveModel::MassAssignmentSecurity)
27
- include Protobuf::ActiveRecord::MassAssignmentSecurity
28
- else
29
- include Protobuf::ActiveRecord::Persistence
30
- end
31
25
  end
32
26
  end
33
27
  end
@@ -1,5 +1,5 @@
1
1
  module Protobuf
2
2
  module ActiveRecord
3
- VERSION = "3.6.1"
3
+ VERSION = "5.0.0.beta"
4
4
  end
5
5
  end
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
22
22
  ##
23
23
  # Dependencies
24
24
  #
25
- spec.add_dependency "activerecord", "~> 4.2"
26
- spec.add_dependency "activesupport", ">= 3.2"
25
+ spec.add_dependency "activerecord", "~> 5.0.0"
26
+ spec.add_dependency "activesupport", "~> 5.0.0"
27
27
  spec.add_dependency "concurrent-ruby"
28
28
  spec.add_dependency "heredity", ">= 0.1.1"
29
29
  spec.add_dependency "protobuf", ">= 3.0"
@@ -5,7 +5,7 @@ ActiveRecord::Base.establish_connection(
5
5
  :database => "spec/test.db"
6
6
  )
7
7
 
8
- ActiveRecord::Base.connection.tables.each do |table|
8
+ ActiveRecord::Base.connection.data_sources.each do |table|
9
9
  ActiveRecord::Base.connection.drop_table(table)
10
10
  end
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.1
4
+ version: 5.0.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hutchison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-24 00:00:00.000000000 Z
11
+ date: 2019-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: 5.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.2'
26
+ version: 5.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.2'
33
+ version: 5.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.2'
40
+ version: 5.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: concurrent-ruby
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -227,9 +227,6 @@ files:
227
227
  - lib/protobuf/active_record/columns.rb
228
228
  - lib/protobuf/active_record/config.rb
229
229
  - lib/protobuf/active_record/errors.rb
230
- - lib/protobuf/active_record/mass_assignment_security.rb
231
- - lib/protobuf/active_record/mass_assignment_security/persistence.rb
232
- - lib/protobuf/active_record/mass_assignment_security/transformation.rb
233
230
  - lib/protobuf/active_record/middleware/connection_management.rb
234
231
  - lib/protobuf/active_record/middleware/connection_management_async.rb
235
232
  - lib/protobuf/active_record/middleware/query_cache.rb
@@ -274,9 +271,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
274
271
  version: '0'
275
272
  required_rubygems_version: !ruby/object:Gem::Requirement
276
273
  requirements:
277
- - - ">="
274
+ - - ">"
278
275
  - !ruby/object:Gem::Version
279
- version: '0'
276
+ version: 1.3.1
280
277
  requirements: []
281
278
  rubygems_version: 3.0.2
282
279
  signing_key:
@@ -1,16 +0,0 @@
1
- require "active_support/concern"
2
- require "protobuf/active_record/mass_assignment_security/persistence"
3
- require "protobuf/active_record/mass_assignment_security/transformation"
4
-
5
- module Protobuf
6
- module ActiveRecord
7
- module MassAssignmentSecurity
8
- extend ::ActiveSupport::Concern
9
-
10
- included do
11
- include Protobuf::ActiveRecord::MassAssignmentSecurity::Persistence
12
- include Protobuf::ActiveRecord::MassAssignmentSecurity::Transformation
13
- end
14
- end
15
- end
16
- end
@@ -1,57 +0,0 @@
1
- require "active_support/concern"
2
-
3
- module Protobuf
4
- module ActiveRecord
5
- module MassAssignmentSecurity
6
- module Persistence
7
- extend ::ActiveSupport::Concern
8
-
9
- module ClassMethods
10
- # :nodoc:
11
- def create(attributes, options = {})
12
- attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message)
13
-
14
- super(attributes, options)
15
- end
16
-
17
- # :nodoc:
18
- def create!(attributes, options = {})
19
- attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message)
20
-
21
- super(attributes, options)
22
- end
23
- end
24
-
25
- # :nodoc:
26
- def assign_attributes(attributes, options = {})
27
- attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message)
28
-
29
- super(attributes, options)
30
- end
31
-
32
- # :nodoc:
33
- def update_attributes(attributes, options = {})
34
- attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message)
35
-
36
- super(attributes, options)
37
- end
38
-
39
- # :nodoc:
40
- def update_attributes!(attributes, options = {})
41
- attributes = attributes_from_proto(attributes) if attributes.is_a?(::Protobuf::Message)
42
-
43
- super(attributes, options)
44
- end
45
- end
46
-
47
- # Override Active Record's initialize method so it can accept a protobuf
48
- # message as it's attributes.
49
- # :noapi:
50
- def initialize(*args, &block)
51
- args[0] = attributes_from_proto(args.first) if args.first.is_a?(::Protobuf::Message)
52
-
53
- super(*args, &block)
54
- end
55
- end
56
- end
57
- end
@@ -1,27 +0,0 @@
1
- require "active_support/concern"
2
-
3
- module Protobuf
4
- module ActiveRecord
5
- module MassAssignmentSecurity
6
- module Transformation
7
- extend ::ActiveSupport::Concern
8
-
9
- module ClassMethods
10
- # Filters protected attributes from the available attributes list. When
11
- # set through accessible attributes, returns the accessible attributes.
12
- # When set through protected attributes, returns the attributes minus any
13
- # protected attributes.
14
- #
15
- # :nodoc:
16
- def _filtered_attributes
17
- if accessible_attributes.present?
18
- accessible_attributes.to_a
19
- else
20
- self.attribute_names - protected_attributes.to_a
21
- end
22
- end
23
- end
24
- end
25
- end
26
- end
27
- end