rename original gangsta to gang
This commit is contained in:
28
app/controllers/gangs_controller.rb
Normal file
28
app/controllers/gangs_controller.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
class GangsController < ApplicationController
|
||||
def show
|
||||
if Gang.count.zero?
|
||||
Gang.create.save
|
||||
end
|
||||
|
||||
json_response Gang.first
|
||||
end
|
||||
|
||||
def update
|
||||
if gang_params[:chip_scale].to_i.positive?
|
||||
Gang.update(gang_params)
|
||||
json_response onboarded: true
|
||||
else
|
||||
error_response :bad_request
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def gang_params
|
||||
params.require(:gang).permit :chip_name,
|
||||
:chip_code,
|
||||
:chip_symbol,
|
||||
:chip_scale,
|
||||
:chip_prefixed
|
||||
end
|
||||
end
|
||||
@@ -1,28 +0,0 @@
|
||||
class OriginalGangstasController < ApplicationController
|
||||
def show
|
||||
if OriginalGangsta.count.zero?
|
||||
OriginalGangsta.create.save
|
||||
end
|
||||
|
||||
json_response OriginalGangsta.first
|
||||
end
|
||||
|
||||
def update
|
||||
if original_gangsta_params[:chip_scale].to_i.positive?
|
||||
OriginalGangsta.update(original_gangsta_params)
|
||||
json_response onboarded: true
|
||||
else
|
||||
error_response :bad_request
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def original_gangsta_params
|
||||
params.require(:original_gangsta).permit :chip_name,
|
||||
:chip_code,
|
||||
:chip_symbol,
|
||||
:chip_scale,
|
||||
:chip_prefixed
|
||||
end
|
||||
end
|
||||
3
app/models/gang.rb
Normal file
3
app/models/gang.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Gang < ApplicationRecord
|
||||
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
class OriginalGangsta < ApplicationRecord
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user