-
-
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 tipos de aliados. Avanza https://gitlab.com/pasosdeJesus…
- Loading branch information
Showing
10 changed files
with
367 additions
and
2 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 TiposaliadoController < Msip::Admin::BasicasController | ||
before_action :set_tipoaliado, | ||
only: [:show, :edit, :update, :destroy] | ||
load_and_authorize_resource class: ::Tipoaliado | ||
|
||
def clase | ||
"::Tipoaliado" | ||
end | ||
|
||
def set_tipoaliado | ||
@basica = Tipoaliado.find(params[:id]) | ||
end | ||
|
||
def atributos_index | ||
[ | ||
:id, | ||
:nombre, | ||
:observaciones, | ||
:fechacreacion_localizada, | ||
:habilitado | ||
] | ||
end | ||
|
||
def genclase | ||
'M' | ||
end | ||
|
||
def tipoaliado_params | ||
params.require(:tipoaliado).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
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 Tipoaliado < 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
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
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
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,49 @@ | ||
class CreateTipoaliado < ActiveRecord::Migration[7.1] | ||
include Msip::SqlHelper | ||
|
||
def up | ||
create_table :tipoaliado 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('tipoaliado', 'nombre', 500, 'es_co_utf_8') | ||
execute <<-SQL | ||
INSERT INTO tipoaliado(id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
1, 'Sin información', | ||
'2024-04-08', '2024-04-08', '2024-04-08'); | ||
INSERT INTO tipoaliado(id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
2, 'Académico', | ||
'2024-04-08', '2024-04-08', '2024-04-08'); | ||
INSERT INTO tipoaliado(id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
3, 'ORP', | ||
'2024-04-08', '2024-04-08', '2024-04-08'); | ||
INSERT INTO tipoaliado(id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
4, 'Sindical', | ||
'2024-04-08', '2024-04-08', '2024-04-08'); | ||
INSERT INTO tipoaliado(id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
5, 'Funcionario institucional', | ||
'2024-04-08', '2024-04-08', '2024-04-08'); | ||
INSERT INTO tipoaliado(id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
6, 'Proveedor', | ||
'2024-04-08', '2024-04-08', '2024-04-08'); | ||
INSERT INTO tipoaliado(id, nombre, | ||
fechacreacion, created_at, updated_at) VALUES ( | ||
7, 'Donante externo', | ||
'2024-04-08', '2024-04-08', '2024-04-08'); | ||
SELECT setval('tipoaliado_id_seq', 100); | ||
SQL | ||
end | ||
def down | ||
drop_table :tipoaliado | ||
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
Oops, something went wrong.