lib/quirky-api/serializers/quirky_serializer.rb
def validates?(field)
    return true if @validations.blank?

    # Check if there is a validation at all for this field.
    validation = @validations[field.to_sym]
    return true if validation.blank?

    # Call block
    instance_exec(&validation) === true
  end
# Confirms that a field passes validations.
#
# @param field [String|Symbol] The field to check validations on.
# @return [Bool] True if the viewer can see, false if not.
Confirms that a field passes validations.
Confirms that a field passes validations .
def validates?(field)
    return true if @validations.blank?
    validation = @validations[field.to_sym]
    return true if validation.blank?
    instance_exec(&validation) === true
  end
def validates? ( field ) return true if @validations . blank? validation = @validations [ field . to_sym ] return true if validation . blank? instance_exec ( & validation ) === true end
Confirms that a field passes validations.
Confirms that a field passes validations .
# Check if there is a validation at all for this field. # Call block
True if the viewer can see, false if not.
True if the viewer can see false if not .
Bool
field
The field to check validations on.
The field to check validations on .