Method: ActiveModel::Error#initialize
- Defined in:
- lib/reactive_record/active_record/error.rb
#initialize(initial_msgs = {}) ⇒ Error
Returns a new instance of Error.
6 7 8 9 |
# File 'lib/reactive_record/active_record/error.rb', line 6 def initialize(initial_msgs = {}) @messages = Hash.new { |h, k| h[k] = [] } initial_msgs.each { |attr, msgs| @messages[attr] = msgs.uniq } end |