Module: PGTrunk::Operation::Validations

Extended by:
ActiveSupport::Concern
Included in:
PGTrunk::Operation
Defined in:
lib/pg_trunk/core/operation/validations.rb

Overview

Enable validation of the operation in the Rails way

Instance Method Summary collapse

Instance Method Details

#error_messagesObject



13
14
15
16
17
18
19
# File 'lib/pg_trunk/core/operation/validations.rb', line 13

def error_messages
  errors.messages.flat_map do |k, v|
    Array(v).map do |msg|
      k == :base ? msg : [k, msg].join(" ")
    end
  end
end