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
e31bc384
Commit
e31bc384
authored
Aug 08, 2016
by
silviu-simeria
Committed by
ifool
Mar 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Managed Rails 5 ActionController::Parameters as Hash
Also fixes failing specs on master for rails 5
parent
563b1d33
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
lib/rails_param/param.rb
+2
-1
No files found.
lib/rails_param/param.rb
View file @
e31bc384
...
@@ -26,7 +26,7 @@ module RailsParam
...
@@ -26,7 +26,7 @@ module RailsParam
if
block_given?
if
block_given?
if
type
==
Array
if
type
==
Array
params
[
name
].
each_with_index
do
|
element
,
i
|
params
[
name
].
each_with_index
do
|
element
,
i
|
if
element
.
is_a?
(
Hash
)
if
element
.
is_a?
(
Hash
)
||
element
.
is_a?
(
ActionController
::
Parameters
)
recurse
element
,
&
block
recurse
element
,
&
block
else
else
params
[
name
][
i
]
=
recurse
({
i
=>
element
},
i
,
&
block
)
# supply index as key unless value is hash
params
[
name
][
i
]
=
recurse
({
i
=>
element
},
i
,
&
block
)
# supply index as key unless value is hash
...
@@ -80,6 +80,7 @@ module RailsParam
...
@@ -80,6 +80,7 @@ module RailsParam
begin
begin
return
nil
if
param
.
nil?
return
nil
if
param
.
nil?
return
param
if
(
param
.
is_a?
(
type
)
rescue
false
)
return
param
if
(
param
.
is_a?
(
type
)
rescue
false
)
return
param
if
(
param
.
is_a?
(
ActionController
::
Parameters
)
&&
type
==
Hash
rescue
false
)
return
Integer
(
param
)
if
type
==
Integer
return
Integer
(
param
)
if
type
==
Integer
return
Float
(
param
)
if
type
==
Float
return
Float
(
param
)
if
type
==
Float
return
String
(
param
)
if
type
==
String
return
String
(
param
)
if
type
==
String
...
...
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