summaryrefslogtreecommitdiff
path: root/engines/support/app
diff options
context:
space:
mode:
Diffstat (limited to 'engines/support/app')
-rw-r--r--engines/support/app/helpers/auto_tickets_path_helper.rb15
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)