lib/rom/schema.rb in rom-3.0.1 vs lib/rom/schema.rb in rom-3.0.2
- old
+ new
@@ -225,11 +225,11 @@
#
# @return [Schema]
#
# @api public
def wrap(prefix = name.dataset)
- new(map { |attr| attr.wrapped(prefix) })
+ new(map { |attr| attr.wrapped? ? attr : attr.wrapped(prefix) })
end
# Return FK attribute for a given relation name
#
# @return [Schema::Attribute]
@@ -340,10 +340,10 @@
# @return [Dry::Types::Hash]
#
# @api private
def to_output_hash
Types::Coercible::Hash.schema(
- map { |attr| [attr.name, attr.to_read_type] }.to_h
+ map { |attr| [attr.key, attr.to_read_type] }.to_h
)
end
# Return coercion function using attribute types
#