update display of the current tasks with IDs [SCI-7205]

This commit is contained in:
Giga Chubinidze 2022-11-08 16:06:48 +04:00
parent 5d40e0cafa
commit 18fe2cd207
3 changed files with 22 additions and 1 deletions

View file

@ -10,6 +10,9 @@ class MyModule < ApplicationRecord
include PermissionCheckableModel
include Assignable
ID_PREFIX = 'TA'
include PrefixedIdModel
attr_accessor :transition_error_rollback
enum state: Extends::TASKS_STATES

View file

@ -1,7 +1,11 @@
<% task_date = current_task_date(task) %>
<a class="current-task-item" href="<%= protocols_my_module_path(task.id) %>">
<div class="current-task-breadcrumbs"><%= task.experiment.project.name %>
<span class="slash">/</span><%= task.experiment.name %></div>
<span class="slash">/</span>
<%= task.experiment.name %>
<span class="slash">/</span>
<%= task.code %>
</div>
<div class="task-name row-border">
<%= task.name %>
</div>

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
class AddMyModuleCodeIndex < ActiveRecord::Migration[6.1]
def up
ActiveRecord::Base.connection.execute(
"CREATE INDEX index_my_modules_on_my_module_code ON "\
"my_modules using gin (('TA'::text || id) gin_trgm_ops);"
)
end
def down
remove_index :my_modules, name: 'index_my_modules_on_my_module_code'
end
end