Skip to content

Commit

Permalink
Español
Browse files Browse the repository at this point in the history
  • Loading branch information
vtamara committed Feb 29, 2024
1 parent 6af0743 commit 506719b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/msip/concerns/controllers/personas_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module PersonasController
included do
include ActionView::Helpers::AssetUrlHelper

before_action :set_persona, only: [:show, :edit, :update, :destroy]
before_action :prepara_persona,
only: [:show, :edit, :update, :destroy]

def clase
"Msip::Persona"
Expand Down Expand Up @@ -257,10 +258,16 @@ def lista_validaciones_conjunto
[:validar_conjunto_familiar_diferente]
end

def set_persona
@persona = Msip::Persona.find(params[:id])
def prepara_persona
if params && params[:id] &&
Msip::Persona.where(id: params[:id]).count > 0
@persona = Msip::Persona.find(params[:id])
else
@persona = Msip::Persona.new
end
@registro = @persona
end
alias_method :set_persona, :prepara_persona

def lista_params_msip
atributos_form + [
Expand Down

0 comments on commit 506719b

Please sign in to comment.