Skip to content

Commit 8b8aecb

Browse files
committed
Merge branch 'develop'
* develop: better regexp for ticket numbers / prevent indexing of empty records remove rsolr
2 parents 1b2de6e + 19e6048 commit 8b8aecb

4 files changed

Lines changed: 7 additions & 84 deletions

File tree

app/controllers/redsun_search_controller.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ class RedsunSearchController < ApplicationController
55
before_action :find_optional_project
66
before_action :set_search_form
77

8+
89
def index
910
searchstring = params[:search_form][:searchstring] || ''
1011

1112
# Redirect to Issue if ticket ID is entered
12-
if searchstring.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1.to_i)
13-
redirect_to controller: 'issues', action: 'show', id: $1
13+
if searchstring.match(/^\s*[#]?(\d+).*$/) && Issue.visible.find_by_id($1.to_i)
14+
redirect_to controller: 'issues', action: 'show', id: $1.to_i
1415
return
1516
end
1617

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name 'Redmine Redsun Plugin'
55
author 'Kieran Hayes'
66
description 'This plugin utilizes the sunspot gem for search'
7-
version '2.1.0'
7+
version '2.1.1'
88
url 'http://www.dkd.de'
99
author_url 'https://www.dkd.de'
1010

lib/redmine_redsun/journal_patch.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ module ClassMethods
6161
module InstanceMethods
6262

6363
def indice_for_sunspot
64-
journalized.journals.map(&:id).index(self.id)+1 if journalized.try(:journals)
64+
if journalized.try(:journals) && journalized.journals.any?
65+
journalized.journals.map(&:id).index(self.id)+1
66+
end
6567
end
6668

6769
def class_name

vendor/rsolr.rb

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)