rom-core 4.2.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -2
  3. data/lib/rom-core.rb +2 -0
  4. data/lib/rom/array_dataset.rb +2 -0
  5. data/lib/rom/association_set.rb +2 -0
  6. data/lib/rom/associations/abstract.rb +2 -0
  7. data/lib/rom/associations/definitions.rb +2 -0
  8. data/lib/rom/associations/definitions/abstract.rb +2 -0
  9. data/lib/rom/associations/definitions/many_to_many.rb +2 -0
  10. data/lib/rom/associations/definitions/many_to_one.rb +2 -0
  11. data/lib/rom/associations/definitions/one_to_many.rb +2 -0
  12. data/lib/rom/associations/definitions/one_to_one.rb +2 -0
  13. data/lib/rom/associations/definitions/one_to_one_through.rb +2 -0
  14. data/lib/rom/associations/many_to_many.rb +2 -0
  15. data/lib/rom/associations/many_to_one.rb +2 -0
  16. data/lib/rom/associations/one_to_many.rb +2 -0
  17. data/lib/rom/associations/one_to_one.rb +2 -0
  18. data/lib/rom/associations/one_to_one_through.rb +2 -0
  19. data/lib/rom/associations/through_identifier.rb +2 -0
  20. data/lib/rom/attribute.rb +58 -72
  21. data/lib/rom/auto_curry.rb +2 -0
  22. data/lib/rom/cache.rb +2 -0
  23. data/lib/rom/command.rb +7 -5
  24. data/lib/rom/command_compiler.rb +2 -0
  25. data/lib/rom/command_proxy.rb +2 -0
  26. data/lib/rom/command_registry.rb +13 -7
  27. data/lib/rom/commands.rb +2 -0
  28. data/lib/rom/commands/class_interface.rb +4 -2
  29. data/lib/rom/commands/composite.rb +2 -0
  30. data/lib/rom/commands/create.rb +2 -0
  31. data/lib/rom/commands/delete.rb +2 -0
  32. data/lib/rom/commands/graph.rb +2 -0
  33. data/lib/rom/commands/graph/class_interface.rb +2 -0
  34. data/lib/rom/commands/graph/input_evaluator.rb +2 -0
  35. data/lib/rom/commands/lazy.rb +2 -0
  36. data/lib/rom/commands/lazy/create.rb +2 -0
  37. data/lib/rom/commands/lazy/delete.rb +2 -0
  38. data/lib/rom/commands/lazy/update.rb +2 -0
  39. data/lib/rom/commands/update.rb +2 -0
  40. data/lib/rom/configuration.rb +2 -0
  41. data/lib/rom/configuration_dsl.rb +2 -0
  42. data/lib/rom/configuration_dsl/command.rb +2 -0
  43. data/lib/rom/configuration_dsl/command_dsl.rb +2 -0
  44. data/lib/rom/configuration_dsl/relation.rb +2 -0
  45. data/lib/rom/configuration_plugin.rb +2 -0
  46. data/lib/rom/constants.rb +3 -0
  47. data/lib/rom/container.rb +2 -0
  48. data/lib/rom/core.rb +4 -1
  49. data/lib/rom/create_container.rb +2 -0
  50. data/lib/rom/data_proxy.rb +2 -0
  51. data/lib/rom/enumerable_dataset.rb +2 -0
  52. data/lib/rom/environment.rb +2 -0
  53. data/lib/rom/gateway.rb +2 -0
  54. data/lib/rom/global.rb +2 -0
  55. data/lib/rom/global/plugin_dsl.rb +2 -0
  56. data/lib/rom/header.rb +198 -0
  57. data/lib/rom/header/attribute.rb +192 -0
  58. data/lib/rom/initializer.rb +2 -0
  59. data/lib/rom/lint/enumerable_dataset.rb +2 -0
  60. data/lib/rom/lint/gateway.rb +2 -0
  61. data/lib/rom/lint/linter.rb +2 -0
  62. data/lib/rom/lint/spec.rb +2 -0
  63. data/lib/rom/lint/test.rb +2 -0
  64. data/lib/rom/mapper.rb +100 -0
  65. data/lib/rom/mapper/attribute_dsl.rb +480 -0
  66. data/lib/rom/mapper/builder.rb +39 -0
  67. data/lib/rom/mapper/configuration_plugin.rb +28 -0
  68. data/lib/rom/mapper/dsl.rb +123 -0
  69. data/lib/rom/mapper/mapper_dsl.rb +45 -0
  70. data/lib/rom/mapper/model_dsl.rb +60 -0
  71. data/lib/rom/mapper_compiler.rb +84 -0
  72. data/lib/rom/mapper_registry.rb +2 -0
  73. data/lib/rom/memory.rb +2 -0
  74. data/lib/rom/memory/associations.rb +2 -0
  75. data/lib/rom/memory/associations/many_to_many.rb +2 -0
  76. data/lib/rom/memory/associations/many_to_one.rb +2 -0
  77. data/lib/rom/memory/associations/one_to_many.rb +2 -0
  78. data/lib/rom/memory/associations/one_to_one.rb +2 -0
  79. data/lib/rom/memory/commands.rb +2 -0
  80. data/lib/rom/memory/dataset.rb +2 -0
  81. data/lib/rom/memory/gateway.rb +2 -0
  82. data/lib/rom/memory/mapper_compiler.rb +2 -0
  83. data/lib/rom/memory/relation.rb +2 -0
  84. data/lib/rom/memory/schema.rb +2 -0
  85. data/lib/rom/memory/storage.rb +2 -0
  86. data/lib/rom/memory/types.rb +2 -0
  87. data/lib/rom/model_builder.rb +103 -0
  88. data/lib/rom/open_struct.rb +37 -0
  89. data/lib/rom/pipeline.rb +2 -0
  90. data/lib/rom/plugin.rb +2 -0
  91. data/lib/rom/plugin_base.rb +2 -0
  92. data/lib/rom/plugin_registry.rb +2 -0
  93. data/lib/rom/plugins/command/schema.rb +2 -0
  94. data/lib/rom/plugins/command/timestamps.rb +2 -0
  95. data/lib/rom/plugins/relation/instrumentation.rb +2 -0
  96. data/lib/rom/plugins/relation/registry_reader.rb +2 -0
  97. data/lib/rom/plugins/schema/timestamps.rb +8 -1
  98. data/lib/rom/processor.rb +30 -0
  99. data/lib/rom/processor/transproc.rb +417 -0
  100. data/lib/rom/registry.rb +2 -0
  101. data/lib/rom/relation.rb +4 -2
  102. data/lib/rom/relation/class_interface.rb +2 -0
  103. data/lib/rom/relation/combined.rb +2 -0
  104. data/lib/rom/relation/commands.rb +2 -0
  105. data/lib/rom/relation/composite.rb +2 -0
  106. data/lib/rom/relation/curried.rb +3 -1
  107. data/lib/rom/relation/graph.rb +2 -0
  108. data/lib/rom/relation/loaded.rb +2 -0
  109. data/lib/rom/relation/materializable.rb +2 -0
  110. data/lib/rom/relation/name.rb +2 -0
  111. data/lib/rom/relation/view_dsl.rb +2 -0
  112. data/lib/rom/relation/wrap.rb +2 -0
  113. data/lib/rom/relation_registry.rb +2 -0
  114. data/lib/rom/schema.rb +39 -6
  115. data/lib/rom/schema/associations_dsl.rb +5 -3
  116. data/lib/rom/schema/dsl.rb +41 -11
  117. data/lib/rom/schema/inferrer.rb +21 -3
  118. data/lib/rom/schema_plugin.rb +2 -0
  119. data/lib/rom/setup.rb +2 -0
  120. data/lib/rom/setup/auto_registration.rb +2 -0
  121. data/lib/rom/setup/auto_registration_strategies/base.rb +3 -1
  122. data/lib/rom/setup/auto_registration_strategies/custom_namespace.rb +2 -0
  123. data/lib/rom/setup/auto_registration_strategies/no_namespace.rb +2 -0
  124. data/lib/rom/setup/auto_registration_strategies/with_namespace.rb +2 -0
  125. data/lib/rom/setup/finalize.rb +2 -0
  126. data/lib/rom/setup/finalize/finalize_commands.rb +2 -0
  127. data/lib/rom/setup/finalize/finalize_mappers.rb +2 -0
  128. data/lib/rom/setup/finalize/finalize_relations.rb +2 -0
  129. data/lib/rom/struct.rb +108 -0
  130. data/lib/rom/struct_compiler.rb +110 -0
  131. data/lib/rom/support/configurable.rb +2 -0
  132. data/lib/rom/support/inflector.rb +2 -0
  133. data/lib/rom/support/memoizable.rb +2 -0
  134. data/lib/rom/support/notifications.rb +2 -0
  135. data/lib/rom/transaction.rb +2 -0
  136. data/lib/rom/transformer.rb +34 -0
  137. data/lib/rom/types.rb +10 -3
  138. data/lib/rom/version.rb +3 -1
  139. metadata +37 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 044b27bb2f62959a8104b8cedfb544d984cf9305ebb6686202ee188289ce25f9
4
- data.tar.gz: 6a6df536dd70a9cd558854d253cebeaef5b92630795fe459315d9719bd463e68
3
+ metadata.gz: b3f8bcda8c133820affac0b652c40ad16434c3c5ceaa3d8ceb34195562f8c4a9
4
+ data.tar.gz: 48611a1d36d140df12fd1ef93860f7349f95e81dc2b4d539da5dad979bf94565
5
5
  SHA512:
6
- metadata.gz: c6bbfd8fb2eb40a8a5797d19fba7c0b168d537ee2fabedcf3b5b1c7cd0d1796ea8a29eb76c591fc29e478fe552da0a0ba6ace9fe6a695641e7f2783f8737abd4
7
- data.tar.gz: 0f9c3e60b6d485ffec63a03e1fbb374ee46c55c3e7325e7c3f963a2dfe7fd05da4b1def89e92aa75387a927c57aa6eaf09dd7279792412471999471d424e582d
6
+ metadata.gz: a97ea813e0ed8ede39740911f2ee45a3679cdc8b50c5461ac0e07f171567f52f6ea77e18e424fb408e82ac67f289ccc98a89b142ade78ae66cc62f3baf4deb83
7
+ data.tar.gz: 06ba213179501490959c77c929fe399dda690baa915b105def02a4179b20e6e819fb5d84dfacb685792ff8605cc8ab407021bc75342dcd92ed8ade1d7cb8473a
data/README.md CHANGED
@@ -1,10 +1,8 @@
1
1
  [gem]: https://rubygems.org/gems/rom-core
2
- [gemnasium]: https://gemnasium.com/rom-rb/rom-core
3
2
 
4
3
  # rom-core [![Gitter chat](https://badges.gitter.im/rom-rb/chat.svg)](https://gitter.im/rom-rb/chat)
5
4
 
6
5
  [![Gem Version](https://badge.fury.io/rb/rom-core.svg)][gem]
7
- [![Dependency Status](https://gemnasium.com/rom-rb/rom-core.svg)][gemnasium]
8
6
 
9
7
  Core API for rom-rb and its adapters and extensions.
10
8
 
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/core'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/initializer'
2
4
  require 'rom/enumerable_dataset'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/registry'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dry/core/constants'
2
4
  require 'dry/core/class_attributes'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/definitions/many_to_many'
2
4
  require 'rom/associations/definitions/many_to_one'
3
5
  require 'rom/associations/definitions/one_to_many'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dry/core/class_attributes'
2
4
 
3
5
  require 'rom/constants'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/types'
2
4
  require 'rom/associations/definitions/abstract'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/definitions/abstract'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/definitions/abstract'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/definitions/abstract'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/definitions/abstract'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/types'
2
4
  require 'rom/associations/abstract'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/abstract'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/abstract'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/one_to_many'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/associations/many_to_many'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rom/support/inflector'
2
4
 
3
5
  module ROM
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dry/equalizer'
2
4
 
3
5
  require 'rom/initializer'
4
6
  require 'rom/support/memoizable'
7
+ require 'rom/types'
5
8
 
6
9
  module ROM
7
10
  # Schema attributes provide meta information about types and an API
@@ -20,12 +23,42 @@ module ROM
20
23
  extend Initializer
21
24
 
22
25
  # @!attribute [r] type
23
- # @return [Dry::Types::Definition, Dry::Types::Sum, Dry::Types::Constrained] The attribute's type object
26
+ # @return [Dry::Types::Nominal, Dry::Types::Sum, Dry::Types::Constrained] The attribute's type object
24
27
  param :type
25
28
 
29
+ # @!attribute [r] name
30
+ #
31
+ # Return the canonical name of this attribute name
32
+ #
33
+ # This *always* returns the name that is used in the datastore, even when
34
+ # an attribute is aliased
35
+ #
36
+ # @example
37
+ # class Users < ROM::Relation[:memory]
38
+ # schema do
39
+ # attribute :user_id, Types::Integer, alias: :id
40
+ # attribute :email, Types::String
41
+ # end
42
+ # end
43
+ #
44
+ # users[:user_id].name
45
+ # # => :user_id
46
+ #
47
+ # users[:email].name
48
+ # # => :email
49
+ #
50
+ # @return [Symbol]
51
+ #
52
+ # @api public
53
+ option :name, optional: true, type: Types::Strict::Symbol
54
+
55
+ # @!attribute [r] type
56
+ # @return [Symbol, nil] Alias to use instead of attribute name
57
+ option :alias, optional: true, type: Types::Strict::Symbol.optional
58
+
26
59
  # @api private
27
- def [](input)
28
- type[input]
60
+ def [](value = Undefined)
61
+ type[value]
29
62
  end
30
63
 
31
64
  # Return true if this attribute type is a primary key
@@ -33,7 +66,7 @@ module ROM
33
66
  # @example
34
67
  # class Users < ROM::Relation[:memory]
35
68
  # schema do
36
- # attribute :id, Types::Int
69
+ # attribute :id, Types::Integer
37
70
  # attribute :name, Types::String
38
71
  #
39
72
  # primary_key :id
@@ -58,7 +91,7 @@ module ROM
58
91
  # @example
59
92
  # class Tasks < ROM::Relation[:memory]
60
93
  # schema do
61
- # attribute :id, Types::Int
94
+ # attribute :id, Types::Integer
62
95
  # attribute :user_id, Types.ForeignKey(:users)
63
96
  # end
64
97
  # end
@@ -76,12 +109,12 @@ module ROM
76
109
  meta[:foreign_key].equal?(true)
77
110
  end
78
111
 
79
- # Return true if this attribute type is a foreign key
112
+ # Return true if this attribute has a configured alias
80
113
  #
81
114
  # @example
82
115
  # class Tasks < ROM::Relation[:memory]
83
116
  # schema do
84
- # attribute :user_id, Types::Int.meta(alias: :id)
117
+ # attribute :user_id, Types::Integer, alias: :id
85
118
  # attribute :name, Types::String
86
119
  # end
87
120
  # end
@@ -96,7 +129,7 @@ module ROM
96
129
  #
97
130
  # @api public
98
131
  def aliased?
99
- !meta[:alias].nil?
132
+ !self.alias.nil?
100
133
  end
101
134
 
102
135
  # Return source relation of this attribute type
@@ -104,7 +137,7 @@ module ROM
104
137
  # @example
105
138
  # class Tasks < ROM::Relation[:memory]
106
139
  # schema do
107
- # attribute :id, Types::Int
140
+ # attribute :id, Types::Integer
108
141
  # attribute :user_id, Types.ForeignKey(:users)
109
142
  # end
110
143
  # end
@@ -127,7 +160,7 @@ module ROM
127
160
  # @example
128
161
  # class Tasks < ROM::Relation[:memory]
129
162
  # schema do
130
- # attribute :id, Types::Int
163
+ # attribute :id, Types::Integer
131
164
  # attribute :user_id, Types.ForeignKey(:users)
132
165
  # end
133
166
  # end
@@ -145,32 +178,6 @@ module ROM
145
178
  meta[:target]
146
179
  end
147
180
 
148
- # Return the canonical name of this attribute name
149
- #
150
- # This *always* returns the name that is used in the datastore, even when
151
- # an attribute is aliased
152
- #
153
- # @example
154
- # class Tasks < ROM::Relation[:memory]
155
- # schema do
156
- # attribute :user_id, Types::Int.meta(alias: :id)
157
- # attribute :name, Types::String
158
- # end
159
- # end
160
- #
161
- # Users.schema[:id].name
162
- # # => :id
163
- #
164
- # Users.schema[:user_id].name
165
- # # => :user_id
166
- #
167
- # @return [Symbol]
168
- #
169
- # @api public
170
- def name
171
- meta[:name]
172
- end
173
-
174
181
  # Return tuple key
175
182
  #
176
183
  # When schemas are projected with aliased attributes, we need a simple access to tuple keys
@@ -178,7 +185,7 @@ module ROM
178
185
  # @example
179
186
  # class Tasks < ROM::Relation[:memory]
180
187
  # schema do
181
- # attribute :user_id, Types::Int.meta(alias: :id)
188
+ # attribute :user_id, Types::Integer, alias: :id
182
189
  # attribute :name, Types::String
183
190
  # end
184
191
  # end
@@ -193,30 +200,7 @@ module ROM
193
200
  #
194
201
  # @api public
195
202
  def key
196
- meta[:alias] || name
197
- end
198
-
199
- # Return attribute's alias
200
- #
201
- # @example
202
- # class Tasks < ROM::Relation[:memory]
203
- # schema do
204
- # attribute :user_id, Types::Int.meta(alias: :id)
205
- # attribute :name, Types::String
206
- # end
207
- # end
208
- #
209
- # Users.schema[:user_id].alias
210
- # # => :user_id
211
- #
212
- # Users.schema[:name].alias
213
- # # => nil
214
- #
215
- # @return [NilClass,Symbol]
216
- #
217
- # @api public
218
- def alias
219
- meta[:alias]
203
+ self.alias || name
220
204
  end
221
205
 
222
206
  # Return new attribute type with provided alias
@@ -224,7 +208,7 @@ module ROM
224
208
  # @example
225
209
  # class Tasks < ROM::Relation[:memory]
226
210
  # schema do
227
- # attribute :user_id, Types::Int
211
+ # attribute :user_id, Types::Integer
228
212
  # attribute :name, Types::String
229
213
  # end
230
214
  # end
@@ -246,7 +230,7 @@ module ROM
246
230
  #
247
231
  # @api public
248
232
  def aliased(name)
249
- meta(alias: name)
233
+ with(alias: name)
250
234
  end
251
235
  alias_method :as, :aliased
252
236
 
@@ -255,7 +239,7 @@ module ROM
255
239
  # @example
256
240
  # class Users < ROM::Relation[:memory]
257
241
  # schema do
258
- # attribute :id, Types::Int
242
+ # attribute :id, Types::Integer
259
243
  # attribute :name, Types::String
260
244
  # end
261
245
  # end
@@ -318,7 +302,7 @@ module ROM
318
302
  # @api public
319
303
  def meta(opts = nil)
320
304
  if opts
321
- self.class.new(type.meta(opts))
305
+ self.class.new(type.meta(opts), options)
322
306
  else
323
307
  type.meta
324
308
  end
@@ -330,7 +314,9 @@ module ROM
330
314
  #
331
315
  # @api public
332
316
  def inspect
333
- %(#<#{self.class}[#{type.name}] #{meta.map { |k, v| "#{k}=#{v.inspect}" }.join(' ')}>)
317
+ opts = options.reject { |k| %i[type name].include?(k) }
318
+ meta_and_opts = meta.merge(opts).map { |k, v| "#{k}=#{v.inspect}" }
319
+ %(#<#{self.class}[#{type.name}] name=#{name.inspect} #{meta_and_opts.join(' ')}>)
334
320
  end
335
321
  alias_method :pretty_inspect, :inspect
336
322
 
@@ -394,7 +380,7 @@ module ROM
394
380
  #
395
381
  # @api public
396
382
  def to_ast
397
- [:attribute, [name, type.to_ast(meta: false), meta_ast]]
383
+ [:attribute, [name, type.to_ast(meta: false), meta_options_ast]]
398
384
  end
399
385
 
400
386
  # Return AST for the read type
@@ -403,18 +389,18 @@ module ROM
403
389
  #
404
390
  # @api public
405
391
  def to_read_ast
406
- [:attribute, [name, to_read_type.to_ast(meta: false), meta_ast]]
392
+ [:attribute, [name, to_read_type.to_ast(meta: false), meta_options_ast]]
407
393
  end
408
394
 
409
395
  # @api private
410
- def meta_ast
411
- meta_keys = %i(wrapped alias primary_key)
412
- ast = meta.select { |k, _| meta_keys.include?(k) }
396
+ def meta_options_ast
397
+ keys = %i[wrapped primary_key alias]
398
+ ast = meta.merge(options).select { |k, _| keys.include?(k) }
413
399
  ast[:source] = source.to_sym if source
414
400
  ast
415
401
  end
416
402
 
417
- memoize :to_ast, :to_read_ast, :meta_ast
403
+ memoize :to_ast, :to_read_ast, :meta_options_ast
418
404
 
419
405
  private
420
406
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ROM
2
4
  # Relation extension which provides auto-currying of relation view methods
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'concurrent/map'
2
4
 
3
5
  module ROM
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dry/core/deprecations'
2
4
  require 'dry/core/class_attributes'
3
5
 
@@ -85,7 +87,7 @@ module ROM
85
87
  # @api public
86
88
  defines :relation
87
89
 
88
- # @!method self.relation
90
+ # @!method self.result
89
91
  # Get or set result type
90
92
  #
91
93
  # @overload result
@@ -101,7 +103,7 @@ module ROM
101
103
  #
102
104
  # @return [Symbol]
103
105
  #
104
- # @overload relation(identifier)
106
+ # @overload result(identifier)
105
107
  # Set result type
106
108
  #
107
109
  # @example
@@ -112,7 +114,7 @@ module ROM
112
114
  # @api public
113
115
  defines :result
114
116
 
115
- # @!method self.relation
117
+ # @!method self.input
116
118
  # Get or set input processing function. This is typically set during setup
117
119
  # to relation's input_schema
118
120
  #
@@ -314,7 +316,7 @@ module ROM
314
316
  if curry_args.empty? && args.first.is_a?(Graph::InputEvaluator)
315
317
  Lazy[self].new(self, *args)
316
318
  else
317
- self.class.build(relation, **options, curry_args: args)
319
+ self.class.build(relation, { **options, curry_args: args })
318
320
  end
319
321
  end
320
322
 
@@ -386,7 +388,7 @@ module ROM
386
388
  #
387
389
  # @api public
388
390
  def new(new_relation)
389
- self.class.build(new_relation, **options, source: relation)
391
+ self.class.build(new_relation, {**options, source: relation})
390
392
  end
391
393
 
392
394
  # Check if this command has any hooks