mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 17:51:13 +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'
|
records = records.active if @view_mode == 'active'
|
||||||
if @params[:search].present?
|
if @params[:search].present?
|
||||||
records = records.where_attributes_like(
|
records = records.where_attributes_like(
|
||||||
["experiments.name", "experiments.description", "('EX' || experiments.id)"],
|
['experiments.name', 'experiments.description', "('EX' || experiments.id)"],
|
||||||
@params[:search]
|
@params[:search]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class FixExperimentIndices < ActiveRecord::Migration[6.1]
|
class FixExperimentIndices < ActiveRecord::Migration[6.1]
|
||||||
def up
|
def up
|
||||||
remove_index :experiments, name: 'index_experiments_on_name', column: 'name'
|
remove_index :experiments, name: 'index_experiments_on_name', column: 'name'
|
||||||
|
|
||||||
|
|
||||||
ActiveRecord::Base.connection.execute(
|
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(
|
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
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue