Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  better regexp for ticket numbers / prevent indexing of empty records
  remove rsolr
  • Loading branch information
KieranHayes committed Jan 16, 2018
2 parents 1b2de6e + 19e6048 commit 8b8aecb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 84 deletions.
5 changes: 3 additions & 2 deletions app/controllers/redsun_search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ class RedsunSearchController < ApplicationController
before_action :find_optional_project
before_action :set_search_form


def index
searchstring = params[:search_form][:searchstring] || ''

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

Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name 'Redmine Redsun Plugin'
author 'Kieran Hayes'
description 'This plugin utilizes the sunspot gem for search'
version '2.1.0'
version '2.1.1'
url 'http://www.dkd.de'
author_url 'https://www.dkd.de'

Expand Down
4 changes: 3 additions & 1 deletion lib/redmine_redsun/journal_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ module ClassMethods
module InstanceMethods

def indice_for_sunspot
journalized.journals.map(&:id).index(self.id)+1 if journalized.try(:journals)
if journalized.try(:journals) && journalized.journals.any?
journalized.journals.map(&:id).index(self.id)+1
end
end

def class_name
Expand Down
80 changes: 0 additions & 80 deletions vendor/rsolr.rb

This file was deleted.

0 comments on commit 8b8aecb

Please sign in to comment.