Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails_param
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
ikcrm_common
rails_param
Commits
563b1d33
Commit
563b1d33
authored
Mar 07, 2016
by
Willian Fernandes
Committed by
ifool
Mar 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Enumerable#include? instead of Hash#member?
Rails 5 is changing and it no longer inherits from hash
parent
0d514aaa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
+1
-1
lib/rails_param/param.rb
+1
-1
No files found.
lib/rails_param/param.rb
View file @
563b1d33
...
@@ -15,7 +15,7 @@ module RailsParam
...
@@ -15,7 +15,7 @@ module RailsParam
def
param!
(
name
,
type
,
options
=
{},
&
block
)
def
param!
(
name
,
type
,
options
=
{},
&
block
)
name
=
name
.
to_s
unless
name
.
is_a?
Integer
# keep index for validating elements
name
=
name
.
to_s
unless
name
.
is_a?
Integer
# keep index for validating elements
return
unless
params
.
member
?
(
name
)
||
check_param_presence?
(
options
[
:default
])
||
options
[
:required
]
return
unless
params
.
include
?
(
name
)
||
check_param_presence?
(
options
[
:default
])
||
options
[
:required
]
begin
begin
params
[
name
]
=
coerce
(
params
[
name
],
type
,
options
)
params
[
name
]
=
coerce
(
params
[
name
],
type
,
options
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment