Skip to content

Commit 5f57a53

Browse files
committed
Comment out code
1 parent 41ac6d1 commit 5f57a53

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lib/mongoid/attributes.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ def write_attribute(name, value)
170170

171171
if attribute_writable?(field_name)
172172
_assigning do
173-
validate_attribute_value(field_name, value)
173+
# TODO: remove this
174+
# validate_attribute_value(field_name, value)
174175
localized = fields[field_name].try(:localized?)
175176
attributes_before_type_cast[name.to_s] = value
176177
typed_value = typed_value_for(field_name, value)
@@ -365,17 +366,18 @@ def unalias_attribute(name)
365366
#
366367
# @param [ String, Symbol ] field_name The name of the field.
367368
# @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
379381

380382
def lookup_attribute_presence(name, value)
381383
if localized_fields.has_key?(name) && value

0 commit comments

Comments
 (0)