@@ -130,29 +130,29 module ActiveRecord #:nodoc: | |||||
130 | include GLoc |
|
130 | include GLoc | |
131 | end |
|
131 | end | |
132 |
|
132 | |||
133 |
|
|
133 | # class Errors | |
134 |
|
|
134 | # include GLoc | |
135 |
|
|
135 | # alias :add_without_gloc :add | |
136 |
|
|
136 | # # The GLoc version of this method provides two extra features | |
137 |
|
|
137 | # # * If <tt>msg</tt> is a string, it will be considered a GLoc string key. | |
138 |
|
|
138 | # # * If <tt>msg</tt> is an array, the first element will be considered | |
139 |
|
|
139 | # # the string and the remaining elements will be considered arguments for the | |
140 |
|
|
140 | # # string. Eg. <tt>['Hi %s.','John']</tt> | |
141 |
|
|
141 | # def add(attribute, msg= @@default_error_messages[:invalid]) | |
142 |
|
|
142 | # if msg.is_a?(Array) | |
143 |
|
|
143 | # args= msg.clone | |
144 |
|
|
144 | # msg= args.shift | |
145 |
|
|
145 | # args= nil if args.empty? | |
146 |
|
|
146 | # end | |
147 |
|
|
147 | # msg= ltry(msg) | |
148 |
|
|
148 | # msg= msg % args unless args.nil? | |
149 |
|
|
149 | # add_without_gloc(attribute, msg) | |
150 |
|
|
150 | # end | |
151 |
|
|
151 | # # Inherits the current language from the base record. | |
152 |
|
|
152 | # def current_language | |
153 |
|
|
153 | # @base.current_language | |
154 |
|
|
154 | # end | |
155 |
|
|
155 | # end | |
156 |
|
156 | |||
157 | module Validations #:nodoc: |
|
157 | module Validations #:nodoc: | |
158 | module ClassMethods |
|
158 | module ClassMethods |
General Comments 0
You need to be logged in to leave comments.
Login now