lib/schematic/generator/restrictions/custom.rb in schematic-0.1.4 vs lib/schematic/generator/restrictions/custom.rb in schematic-0.1.5

- old
+ new

@@ -2,12 +2,13 @@ module Generator module Restrictions class Custom < Base def generate(builder) validators_for_column.each do |validator| - if validator.respond_to?(:xsd_restriction) - restriction = validator.xsd_restriction - builder.xs(:pattern, "value" => restriction.is_a?(Regexp) ? restriction.source : restriction) + if validator.respond_to?(:xsd_pattern_restrictions) + validator.xsd_pattern_restrictions.each do |restriction| + builder.xs(:pattern, "value" => restriction.is_a?(Regexp) ? restriction.source : restriction) + end return end end end end