Class: Validations::BusinessProcessNamesController Private

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/authz/validations/business_process_names_controller.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#editObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/authz/validations/business_process_names_controller.rb', line 16

def edit
  name = params[:business_process][:name]
  business_process = BusinessProcess.find_by(code: name.parameterize(separator: '_'))
  # found = BusinessProcess.exists?(name: name)

  found = business_process.present? && business_process.id != params[:id].to_i
  respond_to do |format|
    format.json {render :json => !found}
  end
end

#newObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
9
10
11
12
13
14
# File 'app/controllers/authz/validations/business_process_names_controller.rb', line 6

def new
  name = params[:business_process][:name]
  # found = BusinessProcess.exists?(name: name)
  found = BusinessProcess.exists?(code: name.parameterize(separator: '_'))

  respond_to do |format|
    format.json {render :json => !found}
  end
end