mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Code style fixes
This commit is contained in:
parent
eaa713f5b8
commit
d67d53b926
2 changed files with 6 additions and 4 deletions
|
@ -50,7 +50,7 @@ class ExperimentsOverviewService
|
|||
records = records.active if @view_mode == 'active'
|
||||
if @params[:search].present?
|
||||
records = records.where_attributes_like(
|
||||
["experiments.name", "experiments.description", "('EX' || experiments.id)"],
|
||||
['experiments.name', 'experiments.description', "('EX' || experiments.id)"],
|
||||
@params[:search]
|
||||
)
|
||||
end
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class FixExperimentIndices < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
remove_index :experiments, name: 'index_experiments_on_name', column: 'name'
|
||||
|
||||
|
||||
ActiveRecord::Base.connection.execute(
|
||||
"CREATE INDEX index_experiments_on_name ON experiments using gin (trim_html_tags(name) gin_trgm_ops);"
|
||||
'CREATE INDEX index_experiments_on_name ON experiments using gin (trim_html_tags(name) gin_trgm_ops);'
|
||||
)
|
||||
|
||||
ActiveRecord::Base.connection.execute(
|
||||
"CREATE INDEX index_experiments_on_description ON experiments using gin (trim_html_tags(description) gin_trgm_ops);"
|
||||
'CREATE INDEX index_experiments_on_description ON experiments ' \
|
||||
'using gin (trim_html_tags(description) gin_trgm_ops);'
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue