pakyow-data 1.0.0.rc2 → 1.0.0.rc3

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: c980f5abe42c630d8c475cc0e7d569e117818e5943ee7e0e9309876fc1282a04
4
- data.tar.gz: a43ad1aed0fe4578108ebf62e5290c5cff0f79dcc60240800ef335cfe2ba2867
3
+ metadata.gz: bc46a555cdeabd3e92057164c7d73eb709e65b249d712a21efab9ac3d823d6b7
4
+ data.tar.gz: de17be63f229e13b4c71dee1c2f688023722390b33ff2b629579049ba464d2ff
5
5
  SHA512:
6
- metadata.gz: 01ccc35983857883367a4571310b33e887b269d7ce934c8ba1084c2c40ae3d3d904886d59da36915df2a617594dfa1d4926b0c65362cc942b36d33f0722230af
7
- data.tar.gz: e68a2cd9848951b0aeae0055cad825e3cc9e2b0418ce9c337b5142c178d25d5fbb4b82931c5fd3c97a294249c0c6a933d6fc8e7a1345ae2be2a1b37622c599d8
6
+ metadata.gz: 515d09959682792f090f2a1584bdfe55bd3a711a3fc486052354141c46ce0087f001bb3d6b6ec1f640601e99b0fc82895d45d00af88220534aa73d35fb76c7bc
7
+ data.tar.gz: c23f714272f8e8e514faa0b8163bb932e211d34c385a29f1c170c21671a13896002ca6c1eff1671f6a0b936990a8f8c1557071fbf7cfc4bd11a5fe0d1c4c8e82
@@ -4,6 +4,7 @@ module Pakyow
4
4
  module Data
5
5
  module Adapters
6
6
  class Sql
7
+ # @api private
7
8
  class Differ
8
9
  def initialize(connection:, source:, attributes: source.attributes)
9
10
  @connection, @source, @attributes = connection, source, attributes
@@ -5,6 +5,7 @@ module Pakyow
5
5
  module Adapters
6
6
  class Sql
7
7
  class Migrator
8
+ # @api private
8
9
  module AdapterMethods
9
10
  module Mysql
10
11
  def create!
@@ -7,6 +7,7 @@ module Pakyow
7
7
  module Data
8
8
  module Adapters
9
9
  class Sql
10
+ # @api private
10
11
  class Migrator < Sources::Relational::Migrator
11
12
  require "pakyow/data/adapters/sql/migrator/adapter_methods"
12
13
 
@@ -7,6 +7,7 @@ module Pakyow
7
7
  module Adapters
8
8
  class Sql
9
9
  module Migrators
10
+ # @api private
10
11
  class Automator < Migrator
11
12
  def associate_table(name, **, &block)
12
13
  alter_table(name, &block)
@@ -7,6 +7,7 @@ module Pakyow
7
7
  module Adapters
8
8
  class Sql
9
9
  module Migrators
10
+ # @api private
10
11
  class Finalizer < Migrator
11
12
  attr_reader :migrations
12
13
 
@@ -4,6 +4,7 @@ module Pakyow
4
4
  module Data
5
5
  module Adapters
6
6
  class Sql
7
+ # @api private
7
8
  class Runner
8
9
  def initialize(connection, migration_path)
9
10
  @connection, @migration_path = connection, migration_path
@@ -11,6 +11,7 @@ require "pakyow/data/adapters/abstract"
11
11
  module Pakyow
12
12
  module Data
13
13
  module Adapters
14
+ # @api private
14
15
  class Sql < Abstract
15
16
  require "pakyow/data/adapters/sql/commands"
16
17
  require "pakyow/data/adapters/sql/dataset_methods"
@@ -31,7 +31,8 @@ module Pakyow
31
31
  name: "#{config.name}-subscribers",
32
32
  path: File.join(
33
33
  Pakyow.config.root, "tmp", "state"
34
- )
34
+ ),
35
+ logger: Pakyow.logger
35
36
  )
36
37
  end
37
38
  end
@@ -6,6 +6,7 @@ require "pakyow/data/types"
6
6
 
7
7
  module Pakyow
8
8
  module Data
9
+ # @api private
9
10
  class Container
10
11
  attr_reader :connection, :sources
11
12
 
@@ -162,6 +162,8 @@ module Pakyow
162
162
  )
163
163
  end
164
164
 
165
+ private
166
+
165
167
  def globalize_connection_opts!(adapter, connection_opts)
166
168
  migrator_for_adapter(adapter).globalize_connection_opts!(connection_opts)
167
169
  end
@@ -85,6 +85,7 @@ module Pakyow
85
85
  class << self
86
86
  attr_reader :name
87
87
 
88
+ # @api private
88
89
  def make(name, state: nil, parent: nil, **kwargs, &block)
89
90
  super(name, state: state, parent: parent, **kwargs, &block)
90
91
  end
@@ -52,6 +52,7 @@ module Pakyow
52
52
  class << self
53
53
  attr_reader :container
54
54
 
55
+ # @api private
55
56
  def instance
56
57
  container.source(plural_name)
57
58
  end
@@ -6,6 +6,7 @@ module Pakyow
6
6
  module Data
7
7
  module Sources
8
8
  class Relational
9
+ # @api private
9
10
  class Association
10
11
  attr_reader :name, :query, :source, :associated_source_name, :associated_source
11
12
 
@@ -25,14 +26,17 @@ module Pakyow
25
26
  @internal = false
26
27
  end
27
28
 
29
+ # @api private
28
30
  def dependent_source_names
29
31
  [@associated_source_name]
30
32
  end
31
33
 
34
+ # @api private
32
35
  def internal?
33
36
  @internal == true
34
37
  end
35
38
 
39
+ # @api private
36
40
  def internal!
37
41
  @internal = true
38
42
  end
@@ -7,6 +7,7 @@ module Pakyow
7
7
  module Sources
8
8
  class Relational
9
9
  module Associations
10
+ # @api private
10
11
  class BelongsTo < Association
11
12
  def type
12
13
  :belongs
@@ -9,6 +9,7 @@ module Pakyow
9
9
  module Sources
10
10
  class Relational
11
11
  module Associations
12
+ # @api private
12
13
  class HasMany < Association
13
14
  attr_reader :associated_name, :dependent
14
15
 
@@ -9,6 +9,7 @@ module Pakyow
9
9
  module Sources
10
10
  class Relational
11
11
  module Associations
12
+ # @api private
12
13
  class HasOne < Association
13
14
  attr_reader :associated_name, :dependent
14
15
 
@@ -11,6 +11,7 @@ module Pakyow
11
11
  module Sources
12
12
  class Relational
13
13
  module Associations
14
+ # @api private
14
15
  class Through
15
16
  attr_reader :joining_source_name, :joining_source
16
17
 
@@ -118,7 +118,7 @@ module Pakyow
118
118
  when Object
119
119
  if association.result_type == :one
120
120
  if association_value.originating_source
121
- if association_value.originating_source == association.associated_source
121
+ if association_value.originating_source.__object_name.name == association.associated_source.__object_name.name
122
122
  if association.associated_source.instance.send(:"by_#{association.associated_source.primary_key_field}", association_value[association.associated_source.primary_key_field]).count == 0
123
123
  raise ConstraintViolation.new_with_message(
124
124
  :associate_missing,
@@ -131,7 +131,7 @@ module Pakyow
131
131
  end
132
132
  end
133
133
 
134
- QUALIFIABLE_TYPES = [Hash, Support::IndifferentHash]
134
+ QUALIFIABLE_TYPES = [Hash, Support::IndifferentHash].freeze
135
135
  def qualified?(qualifications, changed_values, changed_results, original_results)
136
136
  qualifications.all? do |key, value|
137
137
  (QUALIFIABLE_TYPES.include?(changed_values.class) && changed_values.to_h[key] == value) || qualified_result?(key, value, changed_results, original_results)
@@ -6,7 +6,6 @@ module Pakyow
6
6
  module Validations
7
7
  # Validates that the value is unique within its data source.
8
8
  #
9
- # @api public
10
9
  module Unique
11
10
  def self.name
12
11
  :unique
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pakyow-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc2
4
+ version: 1.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-04 00:00:00.000000000 Z
11
+ date: 2019-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pakyow-core
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0.rc2
19
+ version: 1.0.0.rc3
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: 1.0.0.rc2
26
+ version: 1.0.0.rc3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pakyow-support
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0.rc2
33
+ version: 1.0.0.rc3
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: 1.0.0.rc2
40
+ version: 1.0.0.rc3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: concurrent-ruby
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: redis
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '4.1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4.1'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: sequel
85
99
  requirement: !ruby/object:Gem::Requirement