diff --git a/lib/stitches/errors.rb b/lib/stitches/errors.rb index ff5cad5..d1e2ef6 100644 --- a/lib/stitches/errors.rb +++ b/lib/stitches/errors.rb @@ -75,7 +75,7 @@ def self.from_active_record_object(object) else object.errors.full_messages_for(field).sort.join(', ') end - Stitches::Error.new(code: "#{field}_invalid".parameterize, message: message) + Stitches::Error.new(code: code, message: message) } self.new(errors) end