hanami-model 1.0.3 → 1.0.4

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: 26938ba6252cbc720bdfd91be65cab1be7b9c97a
4
- data.tar.gz: 4c040a5a05553bc96b4005ab6ff6548e061c42fe
3
+ metadata.gz: 4a4972da9eec643eb9b1ff52fe1d2f6a626aba4b
4
+ data.tar.gz: 8dc59827cda2726dd50fb02c0ef3cc3488943613
5
5
  SHA512:
6
- metadata.gz: c72428d1c7605407265a7f9a8cd1262d324cc1a6c2aa9b3065de336db887807ac8073dd07d61600d166c40f6771be8617a4a41d4e7519b36dd315c5ba4897493
7
- data.tar.gz: 30072c52994377e97ada94f7214f1ddc5ab941b46e56b8000d00d213209146df5b488cfbd662e9b36696084f0bc07e9c87ebbacd8cf8b0c65ce3ffb192a223b6
6
+ metadata.gz: 1418bf7590d149a90abbd463e728f5a20ab3417fddbfe4fc8a46f61205700224de6fa2a0c685a102575727a6fca821067dd3b739c93fba8d9886f71afa6de8f2
7
+ data.tar.gz: 2de56a5ddd4f1705b553a953ac47c1fe862217e553fb9a2158492f426f234ac6959895403517343d4558fd8c220c57dc8a58106e56e0502278919f57c76aaada
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Hanami::Model
2
2
  A persistence layer for Hanami
3
3
 
4
+ ## v1.0.4 - 2017-10-14
5
+ ### Fixed
6
+ - [Nikita Shilnikov] Keep the dependency on `dry-sql` at `~> 1.3`, which is compatible with `dry-types` `~> 0.11.0`
7
+ - [Nikita Shilnikov] Ensure to write Postgres JSON (`PGJSON`) type for nested associated records
8
+ - [Nikita Shilnikov] Ensure `Repository#select` to work with `Hanami::Model::MappedRelation`
9
+
4
10
  ## v1.0.3 - 2017-10-11
5
11
  ### Fixed
6
12
  - [Luca Guidi] Keep the dependency on `dry-types` at `~> 0.11.0`
data/hanami-model.gemspec CHANGED
@@ -21,7 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.required_ruby_version = '>= 2.3.0'
22
22
 
23
23
  spec.add_runtime_dependency 'hanami-utils', '~> 1.0'
24
- spec.add_runtime_dependency 'rom-sql', '~> 1.3'
24
+ spec.add_runtime_dependency 'rom', '~> 3.3', '>= 3.3.2'
25
+ spec.add_runtime_dependency 'rom-sql', '~> 1.3', '>= 1.3.5'
25
26
  spec.add_runtime_dependency 'rom-repository', '~> 1.4'
26
27
  spec.add_runtime_dependency 'dry-types', '~> 0.11.0'
27
28
  spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
@@ -23,7 +23,7 @@ module Hanami
23
23
  # @since 0.7.0
24
24
  # @api private
25
25
  def [](value)
26
- @mapping.process(@input[value])
26
+ @input[@mapping.process(value)]
27
27
  end
28
28
  end
29
29
 
@@ -31,7 +31,7 @@ module Hanami
31
31
  # @since 0.7.0
32
32
  # @api private
33
33
  def [](value)
34
- return value unless timestamps?
34
+ return @input[value] unless timestamps?
35
35
  _touch(@input[value], Time.now)
36
36
  end
37
37
 
@@ -82,11 +82,21 @@ module Hanami
82
82
  end
83
83
  end
84
84
 
85
+ # @since 1.0.4
86
+ # @api private
87
+ def self.pg_json_pristines
88
+ @pg_json_pristines ||= ::Hash.new do |hash, type|
89
+ hash[type] = if defined?(ROM::SQL::Types::PG)
90
+ ROM::SQL::Types::PG.const_get(type).pristine
91
+ end
92
+ end
93
+ end
94
+
85
95
  # @since 1.0.2
86
96
  # @api private
87
97
  def self.pg_json?(pristine)
88
- (defined?(ROM::SQL::Types::PG::JSONB) && pristine == ROM::SQL::Types::PG::JSONB) ||
89
- (defined?(ROM::SQL::Types::PG::JSON) && pristine == ROM::SQL::Types::PG::JSON)
98
+ pristine == pg_json_pristines['JSONB'.freeze] ||
99
+ pristine == pg_json_pristines['JSON'.freeze]
90
100
  end
91
101
 
92
102
  private_class_method :pg_json?
@@ -3,6 +3,6 @@ module Hanami
3
3
  # Defines the version
4
4
  #
5
5
  # @since 0.1.0
6
- VERSION = '1.0.3'.freeze
6
+ VERSION = '1.0.4'.freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-11 00:00:00.000000000 Z
11
+ date: 2017-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hanami-utils
@@ -24,6 +24,26 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rom
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.3'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 3.3.2
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '3.3'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 3.3.2
27
47
  - !ruby/object:Gem::Dependency
28
48
  name: rom-sql
29
49
  requirement: !ruby/object:Gem::Requirement
@@ -31,6 +51,9 @@ dependencies:
31
51
  - - "~>"
32
52
  - !ruby/object:Gem::Version
33
53
  version: '1.3'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 1.3.5
34
57
  type: :runtime
35
58
  prerelease: false
36
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +61,9 @@ dependencies:
38
61
  - - "~>"
39
62
  - !ruby/object:Gem::Version
40
63
  version: '1.3'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 1.3.5
41
67
  - !ruby/object:Gem::Dependency
42
68
  name: rom-repository
43
69
  requirement: !ruby/object:Gem::Requirement