Skip to content

Commit 2a2c21e

Browse files
committed
Update application_controller.rb
1 parent 5688810 commit 2a2c21e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

app/controllers/application_controller.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ def short_link
105105
list = Register.where(accession: $1).first or not_found
106106
redirect_to(register_path(list, par))
107107
when /\Ag:([a-z]+):(.+)\z/i
108-
genome = Genome.where(database: $1, accession: $2).first or not_found
108+
genome = Genome.where(database: $1, accession: $2).first
109+
unless genome
110+
$stderr.puts 'CANNOT FIND: %s | %s' % [$1, $2]
111+
not_found
112+
end
109113
redirect_to(genome_path(genome, par))
110-
when /\Ag:(.+)\z/i
114+
when /\Ag:(\d+)\z/i
111115
genome = Genome.where(id: $1).first or not_found
112116
redirect_to(genome_path(genome, par))
113117
when /\Ah:(.+)\z/i

0 commit comments

Comments
 (0)