lib/ledger_sync/domains/operation/resource.rb in ledger_sync-domains-1.0.5 vs lib/ledger_sync/domains/operation/resource.rb in ledger_sync-domains-1.1.0
- old
+ new
@@ -8,9 +8,15 @@
def resource_class
@resource_class ||= inferred_resource_class
end
+ def validation_error_message
+ errors.messages.map do |e|
+ "#{e.path.first.to_s.gsub('_', ' ').capitalize} #{e.text}"
+ end.to_sentence
+ end
+
private
def inferred_resource_class
name = self.class.to_s.split('::')
name.pop # remove serializer/operation class from name