diff options
author | Azul <azul@riseup.net> | 2016-03-26 19:59:12 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-05-12 13:00:54 +0200 |
commit | c52d6bb25702fafb60bf9d8dfb9c1afbd77062c0 (patch) | |
tree | 53a64ced3df774e6811266d52391ab25bd2b758a /engines | |
parent | 3a5d8543d710bd69eb7bf908f3aef07db72798a9 (diff) |
bugfix: test user properly in auto_new_ticket_path
Diffstat (limited to 'engines')
-rw-r--r-- | engines/support/app/helpers/auto_tickets_path_helper.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/support/app/helpers/auto_tickets_path_helper.rb b/engines/support/app/helpers/auto_tickets_path_helper.rb index bc98a0a..17fc003 100644 --- a/engines/support/app/helpers/auto_tickets_path_helper.rb +++ b/engines/support/app/helpers/auto_tickets_path_helper.rb @@ -4,7 +4,8 @@ # (1) include the user in the path if appropriate. # (2) retain the sort params, if appropriate. # -# Tickets views with a user_id are limited to that user. For admins, they don't need a user_id for any ticket action. +# Tickets views with a user_id are limited to that user. +# Admins don't need a user_id for any ticket action. # # This is available both to the views and the tickets_controller. # @@ -13,7 +14,6 @@ module AutoTicketsPathHelper protected def auto_tickets_path(options={}) - return unless options.class == Hash options = ticket_view_options.merge options if @user.is_a? User user_tickets_path(@user, options) @@ -22,9 +22,9 @@ module AutoTicketsPathHelper end end - def auto_ticket_path(ticket, options={}) + def auto_ticket_path(ticket) return unless ticket.persisted? - options = ticket_view_options.merge options + options = ticket_view_options if @user.is_a? User user_ticket_path(@user, ticket, options) else @@ -32,10 +32,9 @@ module AutoTicketsPathHelper end end - def auto_new_ticket_path(options={}) - return unless options.class == Hash - options = ticket_view_options.merge options - if @user + def auto_new_ticket_path + options = ticket_view_options + if @user.is_a? User new_user_ticket_path(@user, options) else new_ticket_path(options) |