hanami-model 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/hanami-model.gemspec +1 -1
- data/lib/hanami/entity.rb +1 -1
- data/lib/hanami/model.rb +1 -1
- data/lib/hanami/model/mapped_relation.rb +1 -1
- data/lib/hanami/model/migrator.rb +2 -2
- data/lib/hanami/model/migrator/adapter.rb +2 -2
- data/lib/hanami/model/sql.rb +1 -1
- data/lib/hanami/model/sql/entity/schema.rb +3 -3
- data/lib/hanami/model/sql/types.rb +1 -1
- data/lib/hanami/model/types.rb +1 -1
- data/lib/hanami/model/version.rb +1 -1
- data/lib/hanami/repository.rb +4 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26938ba6252cbc720bdfd91be65cab1be7b9c97a
|
4
|
+
data.tar.gz: 4c040a5a05553bc96b4005ab6ff6548e061c42fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c72428d1c7605407265a7f9a8cd1262d324cc1a6c2aa9b3065de336db887807ac8073dd07d61600d166c40f6771be8617a4a41d4e7519b36dd315c5ba4897493
|
7
|
+
data.tar.gz: 30072c52994377e97ada94f7214f1ddc5ab941b46e56b8000d00d213209146df5b488cfbd662e9b36696084f0bc07e9c87ebbacd8cf8b0c65ce3ffb192a223b6
|
data/CHANGELOG.md
CHANGED
data/hanami-model.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency 'hanami-utils', '~> 1.0'
|
24
24
|
spec.add_runtime_dependency 'rom-sql', '~> 1.3'
|
25
25
|
spec.add_runtime_dependency 'rom-repository', '~> 1.4'
|
26
|
-
spec.add_runtime_dependency 'dry-types', '~> 0.11'
|
26
|
+
spec.add_runtime_dependency 'dry-types', '~> 0.11.0'
|
27
27
|
spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
|
28
28
|
|
29
29
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
data/lib/hanami/entity.rb
CHANGED
@@ -33,7 +33,7 @@ module Hanami
|
|
33
33
|
# end
|
34
34
|
# end
|
35
35
|
#
|
36
|
-
# **Hanami::Model** ships `Hanami::Entity` for developers'
|
36
|
+
# **Hanami::Model** ships `Hanami::Entity` for developers' convenience.
|
37
37
|
#
|
38
38
|
# **Hanami::Model** depends on a narrow and well-defined interface for an
|
39
39
|
# Entity - `#id`, `#id=`, `#initialize(attributes={})`.If your object
|
data/lib/hanami/model.rb
CHANGED
@@ -82,7 +82,7 @@ module Hanami
|
|
82
82
|
|
83
83
|
# Disconnect from the database
|
84
84
|
#
|
85
|
-
# This is useful for
|
85
|
+
# This is useful for rebooting applications in production and to ensure that
|
86
86
|
# the framework prunes stale connections.
|
87
87
|
#
|
88
88
|
# @since 1.0.0
|
@@ -116,7 +116,7 @@ module Hanami
|
|
116
116
|
# # Reads all files from "db/migrations" and apply them
|
117
117
|
# Hanami::Model::Migrator.migrate
|
118
118
|
#
|
119
|
-
# # Migrate to a
|
119
|
+
# # Migrate to a specific version
|
120
120
|
# Hanami::Model::Migrator.migrate(version: "20150610133853")
|
121
121
|
#
|
122
122
|
# NOTE: Class level interface SHOULD be removed in Hanami 2.0
|
@@ -189,7 +189,7 @@ module Hanami
|
|
189
189
|
# migrations 'db/migrations'
|
190
190
|
# end
|
191
191
|
#
|
192
|
-
# Hanami::Model::Migrator.prepare # => creates `foo' and
|
192
|
+
# Hanami::Model::Migrator.prepare # => creates `foo' and runs migrations
|
193
193
|
#
|
194
194
|
# @example Prepare Database (with schema dump)
|
195
195
|
# require 'hanami/model'
|
@@ -123,10 +123,10 @@ module Hanami
|
|
123
123
|
# Returns a database connection
|
124
124
|
#
|
125
125
|
# Given a DB connection URI we can connect to a specific database or not, we need this when creating
|
126
|
-
# or
|
126
|
+
# or dropping a database. Important to notice that we can't always open a _global_ DB connection,
|
127
127
|
# because most of the times application's DB user has no rights to do so.
|
128
128
|
#
|
129
|
-
# @param global [Boolean] determine whether or not a connection should specify
|
129
|
+
# @param global [Boolean] determine whether or not a connection should specify a database.
|
130
130
|
#
|
131
131
|
# @since 0.5.0
|
132
132
|
# @api private
|
data/lib/hanami/model/sql.rb
CHANGED
@@ -22,7 +22,7 @@ module Hanami
|
|
22
22
|
# associations and potentially to mapping defined by the repository.
|
23
23
|
#
|
24
24
|
# @param registry [Hash] a registry that keeps reference between
|
25
|
-
# entities
|
25
|
+
# entities class and their underscored names
|
26
26
|
# @param relation [ROM::Relation] the database relation
|
27
27
|
# @param mapping [Hanami::Model::Mapping] the optional repository
|
28
28
|
# mapping
|
@@ -75,7 +75,7 @@ module Hanami
|
|
75
75
|
# Build the schema
|
76
76
|
#
|
77
77
|
# @param registry [Hash] a registry that keeps reference between
|
78
|
-
# entities
|
78
|
+
# entities class and their underscored names
|
79
79
|
# @param relation [ROM::Relation] the database relation
|
80
80
|
# @param mapping [Hanami::Model::Mapping] the optional repository
|
81
81
|
# mapping
|
@@ -112,7 +112,7 @@ module Hanami
|
|
112
112
|
# Merge attributes and associations
|
113
113
|
#
|
114
114
|
# @param registry [Hash] a registry that keeps reference between
|
115
|
-
# entities
|
115
|
+
# entities class and their underscored names
|
116
116
|
# @param associations [ROM::AssociationSet] a set of associations for
|
117
117
|
# the current relation
|
118
118
|
#
|
@@ -70,7 +70,7 @@ module Hanami
|
|
70
70
|
|
71
71
|
# NOTE: In the future rom-sql should be able to always return Ruby
|
72
72
|
# types instead of Sequel types. When that will happen we can get
|
73
|
-
# rid of this logic in the block and
|
73
|
+
# rid of this logic in the block and fall back to:
|
74
74
|
#
|
75
75
|
# MAPPING.fetch(unwrapped.pristine, attribute)
|
76
76
|
MAPPING.fetch(unwrapped.pristine) do
|
data/lib/hanami/model/types.rb
CHANGED
data/lib/hanami/model/version.rb
CHANGED
data/lib/hanami/repository.rb
CHANGED
@@ -54,7 +54,7 @@ module Hanami
|
|
54
54
|
#
|
55
55
|
# All the queries and commands are private.
|
56
56
|
# This decision forces developers to define intention revealing API, instead
|
57
|
-
#
|
57
|
+
# of leaking storage API details outside of a repository.
|
58
58
|
#
|
59
59
|
# @example
|
60
60
|
# require 'hanami/model'
|
@@ -87,7 +87,7 @@ module Hanami
|
|
87
87
|
# # * It expresses a clear intent.
|
88
88
|
# #
|
89
89
|
# # * The caller can be easily tested in isolation.
|
90
|
-
# # It's just a matter of
|
90
|
+
# # It's just a matter of stubbing this method.
|
91
91
|
# #
|
92
92
|
# # * If we change the storage, the callers aren't affected.
|
93
93
|
#
|
@@ -167,7 +167,7 @@ module Hanami
|
|
167
167
|
# rubocop:enable Metrics/AbcSize
|
168
168
|
# rubocop:enable Metrics/MethodLength
|
169
169
|
|
170
|
-
# Defines the
|
170
|
+
# Defines the mapping between a database table and an entity.
|
171
171
|
#
|
172
172
|
# It's also responsible to associate table columns to entity attributes.
|
173
173
|
#
|
@@ -314,7 +314,7 @@ module Hanami
|
|
314
314
|
module Commands
|
315
315
|
# Create a new record
|
316
316
|
#
|
317
|
-
# @return [Hanami::Entity]
|
317
|
+
# @return [Hanami::Entity] a new created entity
|
318
318
|
#
|
319
319
|
# @raise [Hanami::Model::Error] an error in case the command fails
|
320
320
|
#
|
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.
|
4
|
+
version: 1.0.3
|
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-
|
11
|
+
date: 2017-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hanami-utils
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.11.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 0.11.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: concurrent-ruby
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
requirements: []
|
194
194
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.6.
|
195
|
+
rubygems_version: 2.6.13
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: A persistence layer for Hanami
|