| Class | ActiveRecord::Errors |
| In: |
lib/gloc-rails.rb
|
| Parent: | Object |
| add | -> | add_without_gloc |
The GLoc version of this method provides two extra features
# File lib/gloc-rails.rb, line 141
141: def add(attribute, msg= @@default_error_messages[:invalid])
142: if msg.is_a?(Array)
143: args= msg.clone
144: msg= args.shift
145: args= nil if args.empty?
146: end
147: msg= ltry(msg)
148: msg= msg % args unless args.nil?
149: add_without_gloc(attribute, msg)
150: end