lib/schematic/generator/restrictions/pattern.rb in schematic-0.6.2 vs lib/schematic/generator/restrictions/pattern.rb in schematic-0.7.0
- old
+ new
@@ -1,5 +1,8 @@
+require 'active_model/validations/format'
+require 'schematic/generator/restrictions/base'
+
module Schematic
module Generator
module Restrictions
class Pattern < Base
def generate(builder)
@@ -8,15 +11,13 @@
value = pattern.source
value.gsub!(/^(?:\^|\\A|\\a)?/, '')
value.gsub!(/(?:\$|\\Z|\\z)?$/, '')
value.gsub!(/\\\$/, '$')
value.gsub!(/\(\?:/, '(')
- builder.xs(:pattern, "value" => value)
+ builder.xs(:pattern, 'value' => value)
end
end
end
end
end
end
end
-
-