-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tabla basica regionpago. Closes #221
- Loading branch information
Nombre Usuario
committed
Aug 28, 2023
1 parent
32a702c
commit 953d4b1
Showing
3 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module Admin | ||
class RegionespagoController < Msip::Admin::BasicasController | ||
before_action :set_regionpago, | ||
only: [:show, :edit, :update, :destroy] | ||
load_and_authorize_resource class: ::Regionpago | ||
|
||
def clase | ||
"::Regionpago" | ||
end | ||
|
||
def set_regionpago | ||
@basica = Regionpago.find(params[:id]) | ||
end | ||
|
||
def atributos_index | ||
[ | ||
:id, | ||
:nombre, | ||
:observaciones, | ||
:fechacreacion_localizada, | ||
:habilitado | ||
] | ||
end | ||
|
||
def genclase | ||
'F' | ||
end | ||
|
||
def regionpago_params | ||
params.require(:regionpago).permit(*atributos_form) | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Regionpago < ActiveRecord::Base | ||
include Msip::Basica | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
class CreateRegionpago < ActiveRecord::Migration[7.0] | ||
|
||
include Msip::SqlHelper | ||
|
||
def up | ||
create_table :regionpago do |t| | ||
t.string :nombre, limit: 500, null: false | ||
t.string :observaciones, limit: 5000 | ||
t.date :fechacreacion, null: false | ||
t.date :fechadeshabilitacion | ||
|
||
t.timestamps | ||
end | ||
cambiaCotejacion('regionpago', 'nombre', 500, 'es_co_utf_8') | ||
|
||
execute <<-SQL | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
1, 'SIN INFORMACIÓN', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
2, 'ARMENIA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
3, 'ATLÁNTICO', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
4, 'BOGOTÁ', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
5, 'BOLIVAR', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
6, 'CAQUETA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
7, 'CARTAGENA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
8, 'CESAR', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
9, 'CÓRDOBA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
10, 'CUNDINAMARCA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
12, 'EJE CAFETERO', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
13, 'EJE CAFETERO - RISARALDA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
14, 'EJE CAFETERO - CALDAS', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
16, 'EJE CAFETERO - CHOCO', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
17, 'EJE CAFETERO - QUINDÍO', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
20, 'HUILA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
21, 'MEDELLIN ANTIOQUIA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
22, 'MEDELLIN ANTIOQUIA - RISARALDA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
23, 'NORTE DE SANTANDER Y ARAUCA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
24, 'PACIFICO', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
25, 'PASTO NARIÑO', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
26, 'POPAYAN', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
27, 'PUTUMAYO', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
28, 'RIOHACHA GUAJIRA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
29, 'SANTANDER Y MAGDALENA MEDIO', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
30, 'SUCRE', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
31, 'TOLIMA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
INSERT INTO regionpago (id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
32, 'VALLE DEL CAUCA', '2020-08-05', '2020-08-05', '2020-08-05'); | ||
SELECT setval('regionpago_id_seq', 100); | ||
SQL | ||
end | ||
|
||
def down | ||
drop_table :regionpago | ||
end | ||
end |