Class: Reform::Form::Lotus::Errors

Inherits:
Lotus::Validations::Errors
  • Object
show all
Defined in:
lib/reform/form/lotus.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



17
18
19
# File 'lib/reform/form/lotus.rb', line 17

def inspect
  @errors.to_s
end

#merge!(errors, prefix) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/reform/form/lotus.rb', line 6

def merge!(errors, prefix)
  new_errors = {}
  errors.instance_variable_get(:@errors).each do |name, err|
    field = (prefix+[name]).join(".")
    new_errors[field] = err
  end
  #   next if messages[field] and messages[field].include?(msg)

  new_errors.each { |field, err| add(field, *err) } # TODO: use namespace feature in Lotus here!
end

#messagesObject



21
22
23
# File 'lib/reform/form/lotus.rb', line 21

def messages
  self
end