From 9f36b4c88e7a5534057e8594af8ba58a3cd3ed23 Mon Sep 17 00:00:00 2001 From: pmisaacs1 Date: Sat, 14 Nov 2015 23:38:58 +0000 Subject: [PATCH] Use code variable in creation of Error class --- lib/stitches/errors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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