def validate_attribute_value(access, value)
      return unless fields[access] && value
      validatable_types = [ Hash, Array ]
      if validatable_types.include? fields[access].type
        unless value.is_a? fields[access].type
          raise Mongoid::Errors::InvalidValue.new(fields[access].type, value.class)
        end
      end
    end
def validate_attribute_value(access, value)
      return unless fields[access] && value
      validatable_types = [ Hash, Array ]
      if validatable_types.include? fields[access].type
        unless value.is_a? fields[access].type
          raise Mongoid::Errors::InvalidValue.new(fields[access].type, value.class)
        end
      end
    end
Validates an attribute value. This provides validation checking if
 the value is valid for given a field.
 For now, only Hash and Array fields are validated.

 @param [ String, Symbol ] access The name of the attribute to validate.
 @param [ Object ] value The to be validated.

 @since 3.0.10