Code style fixes

This commit is contained in:
Martin Artnik 2021-06-22 13:27:03 +02:00
parent eaa713f5b8
commit d67d53b926
2 changed files with 6 additions and 4 deletions

View file

@ -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

View file

@ -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