lib/hexx/service.rb in hexx-4.0.0 vs lib/hexx/service.rb in hexx-5.0.0
- old
+ new
@@ -270,7 +270,12 @@
#
# @raise [Hexx::Service::Invalid] when the service object isn't valid.
def validate!
fail Invalid.new(self) unless valid?
end
+
+ def on_error(messages)
+ messages.map(&:text).each { |text| errors.add :base, text }
+ fail Invalid.new(self)
+ end
end
end