@@ -170,7 +170,8 @@ def write_attribute(name, value)
170
170
171
171
if attribute_writable? ( field_name )
172
172
_assigning do
173
- validate_attribute_value ( field_name , value )
173
+ # TODO: remove this
174
+ # validate_attribute_value(field_name, value)
174
175
localized = fields [ field_name ] . try ( :localized? )
175
176
attributes_before_type_cast [ name . to_s ] = value
176
177
typed_value = typed_value_for ( field_name , value )
@@ -365,17 +366,18 @@ def unalias_attribute(name)
365
366
#
366
367
# @param [ String, Symbol ] field_name The name of the field.
367
368
# @param [ Object ] value The value to be validated.
368
- def validate_attribute_value ( field_name , value )
369
- return if value . nil?
370
- field = fields [ field_name ]
371
- return unless field
372
- validatable_types = [ Hash , Array ]
373
- if validatable_types . include? ( field . type )
374
- unless value . is_a? ( field . type )
375
- raise Mongoid ::Errors ::InvalidValue . new ( field . type , value . class )
376
- end
377
- end
378
- end
369
+ # TODO: remove this
370
+ # def validate_attribute_value(field_name, value)
371
+ # return if value.nil?
372
+ # field = fields[field_name]
373
+ # return unless field
374
+ # validatable_types = [ Hash, Array ]
375
+ # if validatable_types.include?(field.type)
376
+ # unless value.is_a?(field.type)
377
+ # raise Mongoid::Errors::InvalidValue.new(field.type, value.class)
378
+ # end
379
+ # end
380
+ # end
379
381
380
382
def lookup_attribute_presence ( name , value )
381
383
if localized_fields . has_key? ( name ) && value
0 commit comments