lib/rom/sql/schema/index_dsl.rb in rom-sql-2.5.0 vs lib/rom/sql/schema/index_dsl.rb in rom-sql-3.0.0
- old
+ new
@@ -24,11 +24,13 @@
def index(*attributes, **options)
registry << [attributes, options]
end
# @api private
- def call(schema_name, types)
- attributes = types.map { |type| attr_class.new(type).meta(source: schema_name) }
+ def call(schema_name, attrs)
+ attributes = attrs.map do |attr|
+ attr_class.new(attr[:type], attr[:options] || {}).meta(source: schema_name)
+ end
registry.map { |attr_names, options|
build_index(attributes, attr_names, options)
}.to_set
end