spec/support/helpers.rb in rom-sql-1.0.0.beta2 vs spec/support/helpers.rb in rom-sql-1.0.0.beta3
- old
+ new
@@ -12,6 +12,10 @@
name,
attributes: attrs.map { |key, value| value.meta(name: key, source: ROM::Relation::Name.new(name)) },
type_class: ROM::SQL::Type
)
end
+
+ def define_type(name, id, **opts)
+ ROM::SQL::Type.new(ROM::Types.const_get(id).meta(name: name, **opts))
+ end
end