mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-25 12:56:21 +00:00
fixup! feat: pluck_param nos ayuda a encontrar un param semanticamente
This commit is contained in:
parent
c1096871a6
commit
54a4deac27
1 changed files with 1 additions and 2 deletions
|
@ -8,9 +8,8 @@ module StrongParamsHelper
|
||||||
# @todo No hay una forma mejor de hacer esto?
|
# @todo No hay una forma mejor de hacer esto?
|
||||||
# @param param [Symbol]
|
# @param param [Symbol]
|
||||||
# @param :optional [Bool]
|
# @param :optional [Bool]
|
||||||
# @param :params [StrongParameters]
|
|
||||||
# @return [nil,String]
|
# @return [nil,String]
|
||||||
def pluck_param(param, optional: false, params: params)
|
def pluck_param(param, optional: false)
|
||||||
if optional
|
if optional
|
||||||
params.permit(param).values.first.presence
|
params.permit(param).values.first.presence
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue