Revision 27752930
Added by Kavita Gaikwad over 7 years ago
app/models/concerns/parameterizable.rb | ||
---|---|---|
end
|
||
|
||
def self.from_param(name)
|
||
self.find_by_name(name)
|
||
self.find_by_name(name.to_s)
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #17343 - set deep munge config off
deep_munge was introduced as a solution to keep
Rails secure by default which results in
'empty array becomes nil in params'.
Thats why, set deep_munge config off in application.rb.
Also, added changes which will cast param argument to string
while calling find_by_{string_type_attr} method on object.