##// END OF EJS Templates
removed translation of error messages inside ActiveRecord module...
Jean-Philippe Lang -
r219:4a988b0f9223
parent child
Show More
@@ -130,29 +130,29 module ActiveRecord #:nodoc:
130 include GLoc
130 include GLoc
131 end
131 end
132
132
133 class Errors
133 # class Errors
134 include GLoc
134 # include GLoc
135 alias :add_without_gloc :add
135 # alias :add_without_gloc :add
136 # The GLoc version of this method provides two extra features
136 # # The GLoc version of this method provides two extra features
137 # * If <tt>msg</tt> is a string, it will be considered a GLoc string key.
137 # # * If <tt>msg</tt> is a string, it will be considered a GLoc string key.
138 # * If <tt>msg</tt> is an array, the first element will be considered
138 # # * If <tt>msg</tt> is an array, the first element will be considered
139 # the string and the remaining elements will be considered arguments for the
139 # # the string and the remaining elements will be considered arguments for the
140 # string. Eg. <tt>['Hi %s.','John']</tt>
140 # # string. Eg. <tt>['Hi %s.','John']</tt>
141 def add(attribute, msg= @@default_error_messages[:invalid])
141 # def add(attribute, msg= @@default_error_messages[:invalid])
142 if msg.is_a?(Array)
142 # if msg.is_a?(Array)
143 args= msg.clone
143 # args= msg.clone
144 msg= args.shift
144 # msg= args.shift
145 args= nil if args.empty?
145 # args= nil if args.empty?
146 end
146 # end
147 msg= ltry(msg)
147 # msg= ltry(msg)
148 msg= msg % args unless args.nil?
148 # msg= msg % args unless args.nil?
149 add_without_gloc(attribute, msg)
149 # add_without_gloc(attribute, msg)
150 end
150 # end
151 # Inherits the current language from the base record.
151 # # Inherits the current language from the base record.
152 def current_language
152 # def current_language
153 @base.current_language
153 # @base.current_language
154 end
154 # end
155 end
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