From c2fbc06d4102eab6b45a3b567795dfac7a198e47 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 23 Mar 2023 17:50:24 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20tenemos=20un=20l=C3=ADo=20de=20singulare?= =?UTF-8?q?s=20y=20plurales?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/usuaries_controller.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/usuaries_controller.rb b/app/controllers/usuaries_controller.rb index 4db6aafd..716668a9 100644 --- a/app/controllers/usuaries_controller.rb +++ b/app/controllers/usuaries_controller.rb @@ -72,7 +72,7 @@ class UsuariesController < ApplicationController site_usuarie = SiteUsuarie.new(@site, current_usuarie) authorize site_usuarie - params[:invite_as] = invited_as :invite_as + params[:invite_as] = invite_as @policy = policy(site_usuarie) end @@ -159,8 +159,12 @@ class UsuariesController < ApplicationController # cualquier cosa, usamos el privilegio menor. # # @return [String] - def invited_as(param_key = :invited_as) - Rol.role?(params[param_key]) ? params[param_key] : Rol::INVITADE + def invited_as + Rol.role?(params[:invited_as]) ? params[:invited_as] : Rol::INVITADE + end + + def invite_as + Rol.role?(params[:invite_as].singularize) ? params[:invite_as] : Rol::INVITADE.pluralize end def site