diff --git a/Gemfile.lock b/Gemfile.lock index 97bdbe1..7ce16a1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,7 +33,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/cor1440_gen.git - revision: fbb7cca9d4a183c516412d0d3ec96b8b18a29186 + revision: 1666533f3d0cd0407dffc0e4eaa6de64f60e4ed6 branch: main specs: cor1440_gen (2.2.0.beta4) @@ -46,7 +46,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/heb412_gen.git - revision: d52ba35198275dfe6eb2b21a711012949b758e93 + revision: 71495453bb62ca518ca00be3aee5add3f3faa8ff branch: main specs: heb412_gen (2.2.0.beta4) @@ -57,7 +57,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/jos19.git - revision: 20139effa97a86277a28bdb60291d13343d98d52 + revision: 8cd3378d3655517101abf0aadd8ffe40519391bf branch: main specs: jos19 (2.2.0.beta4) @@ -65,7 +65,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/mr519_gen.git - revision: e1145e67286320069d48e159c81ea1b30ee77524 + revision: 43e4dfbf40204a240bfac5366aa9bc785e7579b3 branch: main specs: mr519_gen (2.2.0.beta4) @@ -74,7 +74,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/msip.git - revision: 76a5fc04d1c6d26e52d4f15e1e0c68b499f96db2 + revision: 090470149b6fc798f1c056e60c27af6de486543f branch: main specs: msip (2.2.0.beta4) @@ -94,7 +94,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/sivel2_gen.git - revision: 0fa38a4c02552b76cf4ea1a66235e9183fc60f43 + revision: d7b620d767f0f9d4d83866affb74fc2893adcda4 branch: main specs: sivel2_gen (2.2.0.beta4) @@ -232,7 +232,7 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-i18n (1.11.0) + devise-i18n (1.11.1) devise (>= 4.9.0) docile (1.4.0) dotenv (2.8.1) @@ -246,7 +246,7 @@ GEM concurrent-ruby (~> 1.1) webrick (~> 1.7) websocket-driver (>= 0.6, < 0.8) - ffi (1.15.5) + ffi (1.16.2) globalid (1.2.1) activesupport (>= 6.1) hotwire-rails (0.1.3) @@ -389,7 +389,7 @@ GEM rspreadsheet (0.5.3) andand (>= 1.3) rubyzip (>= 1.3) - rubocop (1.56.3) + rubocop (1.56.4) base64 (~> 0.1.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -403,9 +403,9 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.29.0) parser (>= 3.2.1.0) - rubocop-minitest (0.31.1) + rubocop-minitest (0.32.2) rubocop (>= 1.39, < 2.0) - rubocop-rails (2.21.1) + rubocop-rails (2.21.2) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -459,7 +459,7 @@ GEM tzinfo tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -477,7 +477,7 @@ GEM will_paginate (3.3.1) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.11) + zeitwerk (2.6.12) PLATFORMS x86_64-openbsd @@ -550,4 +550,4 @@ DEPENDENCIES will_paginate BUNDLED WITH - 2.4.19 + 2.4.20 diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index e6afebf..90b68a0 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -20,5 +20,6 @@ ActiveSupport::Inflector.inflections do |inflect| inflect.irregular("aliadoasiste", "aliadosasisten") inflect.irregular("cargoestado", "cargosestado") + inflect.irregular("consaportante", "consaportantes") inflect.irregular("regionpago", "regionespago") end diff --git a/db/migrate/20230616203948_familiar_inverso.rb b/db/migrate/20230616203948_familiar_inverso.rb deleted file mode 100644 index af92e85..0000000 --- a/db/migrate/20230616203948_familiar_inverso.rb +++ /dev/null @@ -1,89 +0,0 @@ -class FamiliarInverso < ActiveRecord::Migration[7.0] - def up - execute <<-SQL - CREATE OR REPLACE FUNCTION msip_agregar_o_remplazar_familiar_inverso() - RETURNS trigger AS $ac$ - DECLARE - num2 INTEGER; - rinv CHAR(2); - rexistente CHAR(2); - BEGIN - ASSERT(TG_OP = 'INSERT' OR TG_OP = 'UPDATE'); - RAISE NOTICE 'Insertando o actualizando en msip_persona_trelacion'; - RAISE NOTICE 'TG_OP = %', TG_OP; - RAISE NOTICE 'NEW.id = %', NEW.id; - RAISE NOTICE 'NEW.persona1 = %', NEW.persona1; - RAISE NOTICE 'NEW.persona2 = %', NEW.persona2; - RAISE NOTICE 'NEW.trelacion_id = %', NEW.trelacion_id; - RAISE NOTICE 'NEW.observaciones = %', NEW.observaciones; - - SELECT COUNT(*) INTO num2 FROM msip_persona_trelacion - WHERE persona1 = NEW.persona2 AND persona2=NEW.persona1; - RAISE NOTICE 'num2 = %', num2; - ASSERT(num2 < 2); - SELECT inverso INTO rinv FROM msip_trelacion - WHERE id = NEW.trelacion_id; - RAISE NOTICE 'rinv = %', rinv; - ASSERT(rinv IS NOT NULL); - CASE num2 - WHEN 0 THEN - INSERT INTO msip_persona_trelacion - (persona1, persona2, trelacion_id, observaciones, created_at, updated_at) - VALUES (NEW.persona2, NEW.persona1, rinv, 'Inverso agregado automaticamente', NOW(), NOW()); - ELSE -- num2 = 1 - SELECT trelacion_id INTO rexistente FROM msip_persona_trelacion - WHERE persona1=NEW.persona2 AND persona2=NEW.persona1; - RAISE NOTICE 'rexistente = %', rexistente; - IF rinv <> rexistente THEN - UPDATE msip_persona_trelacion - SET trelacion_id = rinv, - observaciones = 'Inverso cambiado automaticamente (era ' || - rexistente || '). ' || COALESCE(observaciones, ''), - updated_at = NOW() - WHERE persona1=NEW.persona2 AND persona2=NEW.persona1; - END IF; - END CASE; - RETURN NULL; - END ; - $ac$ LANGUAGE plpgsql; - - CREATE OR REPLACE FUNCTION msip_eliminar_familiar_inverso() - RETURNS trigger AS $ac$ - DECLARE - num2 INTEGER; - BEGIN - ASSERT(TG_OP = 'DELETE'); - RAISE NOTICE 'Eliminando inverso de msip_persona_trelacion'; - SELECT COUNT(*) INTO num2 FROM msip_persona_trelacion - WHERE persona1 = OLD.persona2 AND persona2=OLD.persona1; - RAISE NOTICE 'num2 = %', num2; - ASSERT(num2 < 2); - IF num2 = 1 THEN - DELETE FROM msip_persona_trelacion - WHERE persona1 = OLD.persona2 AND persona2 = OLD.persona1; - END IF; - RETURN NULL; - END ; - $ac$ LANGUAGE plpgsql; - - - CREATE OR REPLACE TRIGGER msip_insertar_familiar - AFTER INSERT OR UPDATE ON msip_persona_trelacion - FOR EACH ROW EXECUTE FUNCTION msip_agregar_o_remplazar_familiar_inverso() - ; - - CREATE OR REPLACE TRIGGER msip_eliminar_familiar - AFTER DELETE ON msip_persona_trelacion - FOR EACH ROW EXECUTE FUNCTION msip_eliminar_familiar_inverso() - SQL - end - - def down - execute <<-SQL - DROP TRIGGER msip_eliminar_familiar ON msip_persona_trelacion; - DROP TRIGGER msip_insertar_familiar ON msip_persona_trelacion; - DROP FUNCTION msip_agregar_o_remplazar_familiar_inverso; - DROP FUNCTION msip_eliminar_familiar_inverso(); - SQL - end -end diff --git a/db/structure.sql b/db/structure.sql index 2888df5..74edc13 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9006,6 +9006,41 @@ CREATE UNIQUE INDEX cor1440_gen_actividad_proyectofinanciero_unico ON public.cor CREATE UNIQUE INDEX cor1440_gen_datointermedioti_pmindicadorpf_llaves_idx ON public.cor1440_gen_datointermedioti_pmindicadorpf USING btree (datointermedioti_id, pmindicadorpf_id); +-- +-- Name: i_aporte_anio; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX i_aporte_anio ON public.aporte USING btree (anio); + + +-- +-- Name: i_aporte_anio_mes; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX i_aporte_anio_mes ON public.aporte USING btree (anio, mes); + + +-- +-- Name: i_aporte_anio_mes_persona; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX i_aporte_anio_mes_persona ON public.aporte USING btree (anio, mes, persona_id); + + +-- +-- Name: i_aporte_mes; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX i_aporte_mes ON public.aporte USING btree (mes); + + +-- +-- Name: i_aporte_persona; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX i_aporte_persona ON public.aporte USING btree (persona_id); + + -- -- Name: index_cor1440_gen_actividad_anexo_on_anexo_id; Type: INDEX; Schema: public; Owner: - -- @@ -12528,6 +12563,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20230828100458'), ('20230828144015'), ('20230915210643'), -('20231002183939'); +('20231002183939'), +('20231003083056');