Skip to content

Commit

Permalink
Preserve the options hash when not a params object
Browse files Browse the repository at this point in the history
Before this change, if the second argument was not a params object,
`options` would be set to false. As a Hash responds to `.to_h` just send
it before the merge no matter what.

Fixes zombocom#205
  • Loading branch information
prognostikos committed May 9, 2016
1 parent 68ba6a3 commit 1b47b0c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/wicked/controller/concerns/path.rb
@@ -1,7 +1,6 @@
module Wicked::Controller::Concerns::Path
extend ActiveSupport::Concern


def next_wizard_path(options = {})
wizard_path(@next_step, options)
end
Expand All @@ -18,14 +17,12 @@ def wicked_action
params[:action]
end


def wizard_path(goto_step = nil, options = {})
options = options.to_h if options.respond_to?(:permitted?) && options.respond_to?(:to_h)
options = { :controller => wicked_controller,
:action => 'show',
:id => goto_step || params[:id],
:only_path => true
}.merge options
}.merge options.to_h
url_for(options)
end
end
Expand Down

0 comments on commit 1b47b0c

Please sign in to comment.