Class: ClientSideValidations::Middleware::Uniqueness

Inherits:
Base
  • Object
show all
Defined in:
lib/client_side_validations/middleware.rb

Constant Summary collapse

IGNORE_PARAMS =
%w{case_sensitive id scope}

Instance Attribute Summary

Attributes inherited from Base

#body, #request, #status

Instance Method Summary collapse

Methods inherited from Base

#content_type, #initialize

Constructor Details

This class inherits a constructor from ClientSideValidations::Middleware::Base

Instance Method Details

#responseObject



43
44
45
46
47
48
49
50
51
52
# File 'lib/client_side_validations/middleware.rb', line 43

def response
  if is_unique?
    self.status = 404
    self.body   = 'true'
  else
    self.status = 200
    self.body   = 'false'
  end
  super
end