rename original gangsta to gang

This commit is contained in:
Bilal
2020-10-07 18:26:59 +03:00
parent b5a70a6e42
commit e0c5f60c68
13 changed files with 67 additions and 63 deletions

View 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

View File

@@ -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
View File

@@ -0,0 +1,3 @@
class Gang < ApplicationRecord
end

View File

@@ -1,3 +0,0 @@
class OriginalGangsta < ApplicationRecord
end