Module: Glib::Json::Validation

Defined in:
app/controllers/concerns/glib/json/validation.rb

Instance Method Summary collapse

Instance Method Details

#__json_validate_performObject



2
3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/concerns/glib/json/validation.rb', line 2

def __json_validate_perform
  if Rails.env.development? && params[:_validate] == 'true'
    if (hash = json_transformation_start).is_a?(Hash)
      json_validate = JSONValidate.new(hash)
      response_message = json_validate.valid?
      hash[:_json] = {
        validationErrors: response_message
      }
    end
  end
end