diff options
author | Azul <azul@riseup.net> | 2016-03-26 19:59:12 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-05-02 08:31:18 -0300 |
commit | 6117518350847e83e5b0e79cb206b03ff99d6ee2 (patch) | |
tree | 31679d395fd214463d37ec9bb1e274a54b9ada0f /engines/support/app | |
parent | 500fa2db1d593131d7cebd127c941a44bf174223 (diff) |
bugfix: test user properly in auto_new_ticket_path
Diffstat (limited to 'engines/support/app')
-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) |