rom-mapper 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -0
- data/lib/rom/mapper/version.rb +1 -1
- data/lib/rom/mapper_compiler.rb +12 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4149ea3fe57952060ee08e3932c45d121f4c93e752333b502b16941deef30827
|
4
|
+
data.tar.gz: 2683c0af80f90cb031bbca8cba5ec7c2267deb9b6708f702b4f7ff02a9e27810
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 569075b89b43c815ab029333b6c2327f3ccad50cfe109e3c62a9f596223af81138265e1416eec75711e71ad5ec7cc0ac1f188054e8c11d5109db4c33a35db0ca
|
7
|
+
data.tar.gz: b3e1157ced9c72808fa405e9d4708db7496232b8583b10cb9882fb71c5ca68ac3e384893f2de94fcbcc4c724321bcc137bb58516c2a90f41a5ce17c94cd78fac
|
data/CHANGELOG.md
CHANGED
data/lib/rom/mapper/version.rb
CHANGED
data/lib/rom/mapper_compiler.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'dry/core/class_attributes'
|
2
|
+
|
3
|
+
require 'rom/constants'
|
1
4
|
require 'rom/initializer'
|
2
5
|
require 'rom/mapper'
|
3
6
|
require 'rom/struct'
|
@@ -7,16 +10,24 @@ require 'rom/cache'
|
|
7
10
|
module ROM
|
8
11
|
# @api private
|
9
12
|
class MapperCompiler
|
13
|
+
extend Dry::Core::ClassAttributes
|
10
14
|
extend Initializer
|
11
15
|
|
16
|
+
defines :mapper_options
|
17
|
+
|
18
|
+
mapper_options(EMPTY_HASH)
|
19
|
+
|
12
20
|
option :cache, default: -> { Cache.new }
|
13
21
|
|
14
22
|
attr_reader :struct_compiler
|
15
23
|
|
24
|
+
attr_reader :mapper_options
|
25
|
+
|
16
26
|
def initialize(*args)
|
17
27
|
super
|
18
28
|
@struct_compiler = StructCompiler.new(cache: cache)
|
19
29
|
@cache = cache.namespaced(:mappers)
|
30
|
+
@mapper_options = self.class.mapper_options
|
20
31
|
end
|
21
32
|
|
22
33
|
def call(ast)
|
@@ -44,7 +55,7 @@ module ROM
|
|
44
55
|
end
|
45
56
|
end
|
46
57
|
|
47
|
-
options = [header.map(&method(:visit)), model: model]
|
58
|
+
options = [header.map(&method(:visit)), mapper_options.merge(model: model)]
|
48
59
|
|
49
60
|
if meta[:combine_type]
|
50
61
|
type = meta[:combine_type] == :many ? :array : :hash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-equalizer
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.
|
151
|
+
rubygems_version: 2.7.4
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Standalone data mappers integrated with rom-rb
|