diff --git a/app/controllers/dashboard/quick_start_controller.rb b/app/controllers/dashboard/quick_start_controller.rb index 098b92e49..48cb91c44 100644 --- a/app/controllers/dashboard/quick_start_controller.rb +++ b/app/controllers/dashboard/quick_start_controller.rb @@ -12,7 +12,7 @@ module Dashboard my_module = CreateMyModuleService.new(current_user, current_team, project: @project || create_project_params, experiment: @experiment || create_experiment_params).call - if my_module.errors.empty? + if my_module.errors.blank? render json: { my_module_path: protocols_my_module_path(my_module) } else render json: { errors: my_module.errors, error_object: my_module.class.name }, status: :unprocessable_entity diff --git a/app/controllers/my_module_comments_controller.rb b/app/controllers/my_module_comments_controller.rb index 81b6b91ac..6d168042d 100644 --- a/app/controllers/my_module_comments_controller.rb +++ b/app/controllers/my_module_comments_controller.rb @@ -13,7 +13,7 @@ class MyModuleCommentsController < ApplicationController def index comments = @my_module.last_comments(@last_comment_id, @per_page) - unless comments.empty? + unless comments.blank? more_url = url_for(my_module_my_module_comments_url(@my_module, format: :json, from: comments.first.id)) end comment_index_helper(comments, more_url, @last_comment_id.positive? ? nil : '/my_module_comments/index.html.erb') diff --git a/app/controllers/project_comments_controller.rb b/app/controllers/project_comments_controller.rb index 05f4f67b5..152451780 100644 --- a/app/controllers/project_comments_controller.rb +++ b/app/controllers/project_comments_controller.rb @@ -13,7 +13,7 @@ class ProjectCommentsController < ApplicationController def index comments = @project.last_comments(@last_comment_id, @per_page) - more_url = project_project_comments_url(@project, format: :json, from: comments.first.id) unless comments.empty? + more_url = project_project_comments_url(@project, format: :json, from: comments.first.id) unless comments.blank? comment_index_helper(comments, more_url, @last_comment_id.positive? ? nil : '/project_comments/index.html.erb') end diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index 504241784..245537a65 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -570,7 +570,7 @@ class ProtocolsController < ApplicationController end p_name = - if @protocol_json['name'].present? && !@protocol_json['name'].empty? + if @protocol_json['name'].present? escape_input(@protocol_json['name']) else t('protocols.index.no_protocol_name') @@ -772,7 +772,7 @@ class ProtocolsController < ApplicationController unless protocol_name.nil? escaped_name = protocol_name.gsub(/[^0-9a-zA-Z\-.,_]/i, '_') .downcase[0..Constants::NAME_MAX_LENGTH] - file_name = escaped_name + '.eln' unless escaped_name.empty? + file_name = escaped_name + '.eln' unless escaped_name.blank? end elsif @protocols.length > 1 file_name = 'protocols.eln' diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 5ff2ca8a4..4e3996630 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -279,7 +279,7 @@ class RepositoriesController < ApplicationController else @import_data = parsed_file.data - if @import_data.header.empty? || @import_data.columns.empty? + if @import_data.header.blank? || @import_data.columns.blank? return repository_response(t('repositories.parse_sheet.errors.empty_file')) end diff --git a/app/controllers/repository_columns_controller.rb b/app/controllers/repository_columns_controller.rb index 4281993f5..aee0b4b7a 100644 --- a/app/controllers/repository_columns_controller.rb +++ b/app/controllers/repository_columns_controller.rb @@ -87,7 +87,7 @@ class RepositoryColumnsController < ApplicationController end def available_asset_type_columns - if @asset_columns.empty? + if @asset_columns.blank? render json: { no_items: t( 'projects.reports.new.save_PDF_to_inventory_modal.no_columns' diff --git a/app/controllers/repository_rows_controller.rb b/app/controllers/repository_rows_controller.rb index bfa721807..d2a84a9cb 100644 --- a/app/controllers/repository_rows_controller.rb +++ b/app/controllers/repository_rows_controller.rb @@ -192,7 +192,7 @@ class RepositoryRowsController < ApplicationController end def available_rows - if @repository.repository_rows.active.empty? + if @repository.repository_rows.active.blank? no_items_string = "#{t('projects.reports.new.save_PDF_to_inventory_modal.no_items')} " \ "#{link_to(t('projects.reports.new.save_PDF_to_inventory_modal.here'), diff --git a/app/controllers/result_comments_controller.rb b/app/controllers/result_comments_controller.rb index b1aa0e60c..e3765ef3d 100644 --- a/app/controllers/result_comments_controller.rb +++ b/app/controllers/result_comments_controller.rb @@ -14,7 +14,7 @@ class ResultCommentsController < ApplicationController def index comments = @result.last_comments(@last_comment_id, @per_page) - more_url = result_result_comments_path(@result, format: :json, from: comments.first.id) unless comments.empty? + more_url = result_result_comments_path(@result, format: :json, from: comments.first.id) unless comments.blank? comment_index_helper(comments, more_url) end diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 2d945d30a..334a4bb62 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -76,7 +76,7 @@ class SearchController < ApplicationController @search_query += "#{splited_query[i]} " end end - if @search_query.empty? + if @search_query.blank? flash[:error] = t('general.query.wrong_query', min_length: Constants::NAME_MIN_LENGTH, max_length: Constants::TEXT_MAX_LENGTH) diff --git a/app/controllers/step_comments_controller.rb b/app/controllers/step_comments_controller.rb index c04ba91e5..4ffa15a89 100644 --- a/app/controllers/step_comments_controller.rb +++ b/app/controllers/step_comments_controller.rb @@ -14,7 +14,7 @@ class StepCommentsController < ApplicationController def index comments = @step.last_comments(@last_comment_id, @per_page) - more_url = step_step_comments_path(@step, format: :json, from: comments.first.id) unless comments.empty? + more_url = step_step_comments_path(@step, format: :json, from: comments.first.id) unless comments.blank? comment_index_helper(comments, more_url) end diff --git a/app/controllers/steps_controller.rb b/app/controllers/steps_controller.rb index 1bb3d22f1..527bfab5c 100644 --- a/app/controllers/steps_controller.rb +++ b/app/controllers/steps_controller.rb @@ -84,7 +84,7 @@ class StepsController < ApplicationController end respond_to do |format| - if @step.errors.empty? + if @step.errors.blank? format.json do render json: { html: render_to_string( @@ -392,7 +392,7 @@ class StepsController < ApplicationController update_params = {} delete_step_tables(params) extract_destroy_params(params, update_params) - @step.update(update_params) unless update_params.empty? + @step.update(update_params) unless update_params.blank? end # Delete the step table diff --git a/app/controllers/users/invitations_controller.rb b/app/controllers/users/invitations_controller.rb index 900fac162..fa832060f 100644 --- a/app/controllers/users/invitations_controller.rb +++ b/app/controllers/users/invitations_controller.rb @@ -22,7 +22,7 @@ module Users @team.name = params[:team][:name] super do |user| - if user.errors.empty? + if user.errors.blank? @team.created_by = user @team.save diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 7d7b804cc..c1f963cfb 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -19,7 +19,7 @@ module Users auth = request.env['omniauth.auth'] provider_id = auth.dig(:extra, :raw_info, :id_token_claims, :aud) provider_conf = Rails.configuration.x.azure_ad_apps[provider_id] - raise StandardError, 'No matching Azure AD provider config found' if provider_conf.empty? + raise StandardError, 'No matching Azure AD provider config found' if provider_conf.blank? auth.provider = provider_conf[:provider] @@ -161,7 +161,7 @@ module Users def generate_initials(full_name) initials = full_name.titleize.scan(/[A-Z]+/).join - initials = initials.strip.empty? ? 'PLCH' : initials[0..3] + initials = initials.strip.blank? ? 'PLCH' : initials[0..3] initials end end diff --git a/app/controllers/users/passwords_controller.rb b/app/controllers/users/passwords_controller.rb index df21e92db..30df7aaa9 100644 --- a/app/controllers/users/passwords_controller.rb +++ b/app/controllers/users/passwords_controller.rb @@ -19,7 +19,7 @@ class Users::PasswordsController < Devise::PasswordsController self.resource = resource_class.reset_password_by_token(resource_params) yield resource if block_given? - if resource.errors.empty? + if resource.errors.blank? resource.unlock_access! if unlockable?(resource) if !resource.two_factor_auth_enabled? flash_message = resource.active_for_authentication? ? :updated : :updated_not_active diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 59cad1e09..d3ae4eb8f 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -216,7 +216,7 @@ class Users::RegistrationsController < Devise::RegistrationsController def sign_up_params tmp = params.require(:user).permit(:full_name, :initials, :email, :password, :password_confirmation) initials = tmp[:full_name].titleize.scan(/[A-Z]+/).join() - initials = if initials.strip.empty? + initials = if initials.strip.blank? 'PLCH' else initials[0..Constants::USER_INITIALS_MAX_LENGTH] diff --git a/app/datatables/load_from_repository_protocols_datatable.rb b/app/datatables/load_from_repository_protocols_datatable.rb index a6d3ffd36..aed2339f1 100644 --- a/app/datatables/load_from_repository_protocols_datatable.rb +++ b/app/datatables/load_from_repository_protocols_datatable.rb @@ -142,7 +142,7 @@ class LoadFromRepositoryProtocolsDatatable < CustomDatatable end def keywords_html(record) - if !record.protocol_keywords_str || record.protocol_keywords_str.empty? + if record.protocol_keywords_str.blank? "#{I18n.t("protocols.no_keywords")}" else kws = record.protocol_keywords_str.split(", ") diff --git a/app/datatables/protocols_datatable.rb b/app/datatables/protocols_datatable.rb index 9923f11e0..2160049ce 100644 --- a/app/datatables/protocols_datatable.rb +++ b/app/datatables/protocols_datatable.rb @@ -183,7 +183,7 @@ class ProtocolsDatatable < CustomDatatable end def keywords_html(record) - if !record.protocol_keywords_str || record.protocol_keywords_str.empty? + if !record.protocol_keywords_str || record.protocol_keywords_str.blank? "#{I18n.t("protocols.no_keywords")}" else kws = record.protocol_keywords_str.split(", ") diff --git a/app/models/concerns/searchable_by_name_model.rb b/app/models/concerns/searchable_by_name_model.rb index f0f78cff4..b1b3dec0b 100644 --- a/app/models/concerns/searchable_by_name_model.rb +++ b/app/models/concerns/searchable_by_name_model.rb @@ -22,7 +22,7 @@ module SearchableByNameModel end def self.filter_by_teams(teams = []) - return self if teams.empty? + return self if teams.blank? if column_names.include? 'team_id' where(team_id: teams) diff --git a/app/models/concerns/searchable_model.rb b/app/models/concerns/searchable_model.rb index 770bfb396..f61c7b9d2 100644 --- a/app/models/concerns/searchable_model.rb +++ b/app/models/concerns/searchable_model.rb @@ -26,7 +26,7 @@ module SearchableModel if options[:whole_word].to_s == 'true' || options[:whole_phrase].to_s == 'true' || options[:at_search].to_s == 'true' - unless attrs.empty? + unless attrs.blank? like = options[:match_case].to_s == 'true' ? '~' : '~*' like = 'SIMILAR TO' if options[:at_search].to_s == 'true' @@ -65,7 +65,7 @@ module SearchableModel like = options[:match_case].to_s == 'true' ? 'LIKE' : 'ILIKE' if query.count(' ') > 0 - unless attrs.empty? + unless attrs.blank? a_query = query.split.map { |a| "%#{sanitize_sql_like(a)}%" } where_str = (attrs.map.with_index do |a, i| @@ -87,7 +87,7 @@ module SearchableModel return where(where_str, vals) end else - unless attrs.empty? + unless attrs.blank? where_str = (attrs.map.with_index do |a, i| if %w(repository_rows.id repository_number_values.data).include?(a) diff --git a/app/models/experiment.rb b/app/models/experiment.rb index c4f858e1b..6226311eb 100644 --- a/app/models/experiment.rb +++ b/app/models/experiment.rb @@ -240,7 +240,7 @@ class Experiment < ApplicationRecord projects = projects_with_role_above_user(current_user) projects = projects.each_with_object([]) do |p, arr| - arr << p if (project.users - p.users).empty? + arr << p if (project.users - p.users).blank? arr end projects - [project] diff --git a/app/models/my_module.rb b/app/models/my_module.rb index cc2635eea..3145730c9 100644 --- a/app/models/my_module.rb +++ b/app/models/my_module.rb @@ -286,7 +286,7 @@ class MyModule < ApplicationRecord def downstream_modules final = [] modules = [self] - until modules.empty? + until modules.blank? my_module = modules.shift final << my_module unless final.include?(my_module) modules.push(*my_module.my_modules) @@ -298,7 +298,7 @@ class MyModule < ApplicationRecord def upstream_modules final = [] modules = [self] - until modules.empty? + until modules.blank? my_module = modules.shift final << my_module unless final.include?(my_module) modules.push(*my_module.my_module_antecessors) @@ -395,7 +395,7 @@ class MyModule < ApplicationRecord positions = experiment.my_modules.active.collect { |m| [m.x, m.y] } .select { |x, _| x >= 0 && x < WIDTH } .sort_by { |_, y| y } - return { x: 0, y: 0 } if positions.empty? || positions.first[1] >= HEIGHT + return { x: 0, y: 0 } if positions.blank? || positions.first[1] >= HEIGHT # It looks we'll have to find a gap between the modules if it exists (at # least 2*HEIGHT wide diff --git a/app/models/my_module_status.rb b/app/models/my_module_status.rb index f12115e5a..3315dd7d2 100644 --- a/app/models/my_module_status.rb +++ b/app/models/my_module_status.rb @@ -33,11 +33,11 @@ class MyModuleStatus < ApplicationRecord def self.sort_by_position(order = :asc) ordered_statuses, statuses = all.to_a.partition { |i| i.previous_status_id.nil? } - return [] if ordered_statuses.empty? + return [] if ordered_statuses.blank? - until statuses.empty? + until statuses.blank? next_element, statuses = statuses.partition { |i| ordered_statuses.last.id == i.previous_status_id } - if next_element.empty? + if next_element.blank? break else ordered_statuses.concat(next_element) diff --git a/app/models/project.rb b/app/models/project.rb index 6999cc9da..253860275 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -224,7 +224,7 @@ class Project < ApplicationRecord ids = active_experiments.map do |exp| exp.my_modules.pluck(:id) if exp.my_modules end - ids.delete_if { |i| i.flatten.empty? } + ids.delete_if { |i| i.flatten.blank? } ids.join(', ') end diff --git a/app/models/tiny_mce_asset.rb b/app/models/tiny_mce_asset.rb index 6b92ed06f..76c6cc7c9 100644 --- a/app/models/tiny_mce_asset.rb +++ b/app/models/tiny_mce_asset.rb @@ -131,7 +131,7 @@ class TinyMceAsset < ApplicationRecord order(:id).each do |tiny_mce_asset| asset_guid = get_guid(tiny_mce_asset.id) extension = tiny_mce_asset.image.blob.filename.extension - asset_file_name = if extension.empty? + asset_file_name = if extension.blank? "rte-#{asset_guid}" else "rte-#{asset_guid}.#{tiny_mce_asset.image.blob.filename.extension}" diff --git a/app/serializers/api/v1/inventory_item_serializer.rb b/app/serializers/api/v1/inventory_item_serializer.rb index 9864a2078..e27c1c7b6 100644 --- a/app/serializers/api/v1/inventory_item_serializer.rb +++ b/app/serializers/api/v1/inventory_item_serializer.rb @@ -8,7 +8,7 @@ module Api has_many :repository_cells, key: :inventory_cells, serializer: InventoryCellSerializer, class_name: 'RepositoryCell', - unless: -> { object.repository_cells.empty? } + unless: -> { object.repository_cells.blank? } belongs_to :repository, key: :inventory, serializer: InventorySerializer, class_name: 'Repository', diff --git a/app/serializers/api/v1/protocol_serializer.rb b/app/serializers/api/v1/protocol_serializer.rb index 97df41546..b5fe6559e 100644 --- a/app/serializers/api/v1/protocol_serializer.rb +++ b/app/serializers/api/v1/protocol_serializer.rb @@ -13,7 +13,7 @@ module Api key: :keywords, serializer: ProtocolKeywordSerializer, class_name: 'ProtocolKeyword', - unless: -> { object.protocol_keywords.empty? } + unless: -> { object.protocol_keywords.blank? } has_many :steps, serializer: StepSerializer, if: -> { object.steps.any? } belongs_to :parent, serializer: ProtocolSerializer, if: -> { object.parent.present? } diff --git a/app/serializers/api/v1/task_group_serializer.rb b/app/serializers/api/v1/task_group_serializer.rb index 92806a487..b0e5279de 100644 --- a/app/serializers/api/v1/task_group_serializer.rb +++ b/app/serializers/api/v1/task_group_serializer.rb @@ -8,7 +8,7 @@ module Api has_many :my_modules, key: :tasks, serializer: TaskSerializer, class_name: 'MyModule', - unless: -> { object.my_modules.empty? } + unless: -> { object.my_modules.blank? } include TimestampableModel end diff --git a/app/services/create_experiment_service.rb b/app/services/create_experiment_service.rb index c2d1e4d29..ee99769e9 100644 --- a/app/services/create_experiment_service.rb +++ b/app/services/create_experiment_service.rb @@ -13,7 +13,7 @@ class CreateExperimentService unless @params[:project].class == Project @params[:project] = CreateProjectService.new(@user, @team, @params[:project]).call end - unless @params[:project]&.errors&.empty? + unless @params[:project]&.errors&.blank? new_experiment = @params[:project] raise ActiveRecord::Rollback end diff --git a/app/services/create_my_module_service.rb b/app/services/create_my_module_service.rb index e4e202f33..82e4ea984 100644 --- a/app/services/create_my_module_service.rb +++ b/app/services/create_my_module_service.rb @@ -15,7 +15,7 @@ class CreateMyModuleService @params[:experiment][:project] = @params[:project] @params[:experiment] = CreateExperimentService.new(@user, @team, @params[:experiment]).call end - unless @params[:experiment]&.errors&.empty? + unless @params[:experiment]&.errors&.blank? new_my_module = @params[:experiment] raise ActiveRecord::Rollback end diff --git a/app/services/marvin_js_service.rb b/app/services/marvin_js_service.rb index d530fba92..8bc8d890c 100644 --- a/app/services/marvin_js_service.rb +++ b/app/services/marvin_js_service.rb @@ -82,7 +82,7 @@ class MarvinJsService end def prepare_name(sketch_name) - if !sketch_name.empty? + if !sketch_name.blank? sketch_name else I18n.t('marvinjs.new_sketch') diff --git a/app/services/reports/html_to_word_converter.rb b/app/services/reports/html_to_word_converter.rb index ad82bbd01..77710af96 100644 --- a/app/services/reports/html_to_word_converter.rb +++ b/app/services/reports/html_to_word_converter.rb @@ -53,7 +53,7 @@ module Reports next unless elem if %w(image newline table ol ul).include? elem[:type] - unless temp_p.empty? + unless temp_p.blank? elements.push(type: 'p', children: temp_p) temp_p = [] end diff --git a/app/services/repository_rows/create_repository_row_service.rb b/app/services/repository_rows/create_repository_row_service.rb index 5a90cb1d2..be76e5a8b 100644 --- a/app/services/repository_rows/create_repository_row_service.rb +++ b/app/services/repository_rows/create_repository_row_service.rb @@ -25,7 +25,7 @@ module RepositoryRows params[:repository_cells]&.each do |column_id, value| column = @repository.repository_columns.find_by(id: column_id) - next if !column || value.empty? + next if !column || value.blank? RepositoryCell.create_with_value!(@repository_row, column, value, @user) end diff --git a/app/services/smart_annotations/tag_to_text.rb b/app/services/smart_annotations/tag_to_text.rb index aae1a516b..edf205121 100644 --- a/app/services/smart_annotations/tag_to_text.rb +++ b/app/services/smart_annotations/tag_to_text.rb @@ -45,7 +45,7 @@ module SmartAnnotations match = el.match(USER_REGEX) user = User.find_by_id(match[2].base62_decode) next unless user - next if UserTeam.where(user: user, team: team).empty? + next if UserTeam.where(user: user, team: team).blank? user.full_name end end diff --git a/app/utilities/repository_import_parser/importer.rb b/app/utilities/repository_import_parser/importer.rb index 09445fa66..84fb1a1a0 100644 --- a/app/utilities/repository_import_parser/importer.rb +++ b/app/utilities/repository_import_parser/importer.rb @@ -63,7 +63,7 @@ module RepositoryImportParser @rows.each do |row| # Skip empty rows - next if row.empty? + next if row.blank? unless @header_skipped @header_skipped = true diff --git a/app/utilities/users_generator.rb b/app/utilities/users_generator.rb index 769a9bfdc..fba6facb9 100644 --- a/app/utilities/users_generator.rb +++ b/app/utilities/users_generator.rb @@ -49,7 +49,7 @@ module UsersGenerator end # Assign user team as user current team - nu.current_team_id = nu.teams.first.id unless nu.teams.empty? + nu.current_team_id = nu.teams.first.id unless nu.teams.blank? nu.save! nu.reload diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb index 6bf1386ee..9fe33c359 100644 --- a/app/views/activities/index.html.erb +++ b/app/views/activities/index.html.erb @@ -4,7 +4,7 @@
- <% if not @search_category.empty? %> + <% if not @search_category.blank? %>
diff --git a/app/views/search/results/_modules.html.erb b/app/views/search/results/_modules.html.erb index 7b3f32318..a8e4ce663 100644 --- a/app/views/search/results/_modules.html.erb +++ b/app/views/search/results/_modules.html.erb @@ -4,7 +4,7 @@ <%= render partial: "search/results/partials/my_module_text.html.erb", locals: { my_module: mod, query: search_query } %> - <% if mod.description.present? && !mod.description.empty? %> + <% if mod.description.present? %>

<%=t "search.index.description" %> diff --git a/app/views/search/results/_protocols.html.erb b/app/views/search/results/_protocols.html.erb index 7ea1e8a0a..97377a1f0 100644 --- a/app/views/search/results/_protocols.html.erb +++ b/app/views/search/results/_protocols.html.erb @@ -1,6 +1,6 @@ <% results.each do |protocol| %> - <% has_description = protocol.description.present? && !protocol.description.empty? %> - <% has_authors = protocol.authors.present? && !protocol.authors.empty? %> + <% has_description = protocol.description.present? %> + <% has_authors = protocol.authors.present? %> <% has_keywords = protocol.in_repository? && protocol.protocol_keywords.count > 0 %>

@@ -122,5 +122,3 @@
<% end %> - - diff --git a/app/views/search/results/_results.html.erb b/app/views/search/results/_results.html.erb index 7c7f1b312..9e72e113f 100644 --- a/app/views/search/results/_results.html.erb +++ b/app/views/search/results/_results.html.erb @@ -14,7 +14,7 @@ <%= render partial: "search/results/partials/result_text.html.erb", locals: { result: result, query: search_query, target: nil } %>
- <% if result.is_text && result.result_text.text.present? && !result.result_text.text.empty? %> + <% if result.is_text && result.result_text.text.present? %>

<%= highlight custom_auto_link(result.result_text.tinymce_render(:text), diff --git a/app/views/search/results/_steps.html.erb b/app/views/search/results/_steps.html.erb index 5c8494bd1..fab45cbdf 100644 --- a/app/views/search/results/_steps.html.erb +++ b/app/views/search/results/_steps.html.erb @@ -4,7 +4,7 @@ <%= render partial: "search/results/partials/step_text.html.erb", locals: { step: step, query: search_query, target: nil } %> - <% if step.description.present? && !step.description.empty? %> + <% if step.description.present? %>

<%=t "search.index.description" %> diff --git a/app/views/search/results/partials/_protocol_text.html.erb b/app/views/search/results/partials/_protocol_text.html.erb index a14a85707..2af44e31f 100644 --- a/app/views/search/results/partials/_protocol_text.html.erb +++ b/app/views/search/results/partials/_protocol_text.html.erb @@ -1,5 +1,5 @@ <% query ||= nil %> -<% text = query.present? ? highlight(protocol.name, query.strip.split(/\s+/)) : (protocol.name.empty? ? t("search.index.no_name") : protocol.name) %> +<% text = query.present? ? highlight(protocol.name, query.strip.split(/\s+/)) : (protocol.name.blank? ? t("search.index.no_name") : protocol.name) %> <% if protocol.in_repository_public? %> diff --git a/app/views/shared/_left_menu_bar.html.erb b/app/views/shared/_left_menu_bar.html.erb index e607dedba..6c353602f 100644 --- a/app/views/shared/_left_menu_bar.html.erb +++ b/app/views/shared/_left_menu_bar.html.erb @@ -1,7 +1,7 @@

diff --git a/app/views/shared/smart_annotation/_project_items.html.erb b/app/views/shared/smart_annotation/_project_items.html.erb index 710ac43c7..ff6ea9f39 100644 --- a/app/views/shared/smart_annotation/_project_items.html.erb +++ b/app/views/shared/smart_annotation/_project_items.html.erb @@ -9,7 +9,7 @@ <% if limit_reached %>
<%= t('atwho.more_results') %>
<% end %> - <% if projects.empty? %> + <% if projects.blank? %> <%= render partial: 'shared/smart_annotation/no_results.html.erb', locals: { object_type: 'projects' } %> <% end %>
diff --git a/app/views/shared/smart_annotation/_repository_items.html.erb b/app/views/shared/smart_annotation/_repository_items.html.erb index 784a9999a..ae40e198f 100644 --- a/app/views/shared/smart_annotation/_repository_items.html.erb +++ b/app/views/shared/smart_annotation/_repository_items.html.erb @@ -9,7 +9,7 @@ <% if limit_reached %>
<%= t('atwho.more_results') %>
<% end %> - <% if repository_rows.empty? %> + <% if repository_rows.blank? %> <%= render partial: 'shared/smart_annotation/no_results.html.erb', locals: { object_type: 'repository_rows' } %> <% end %>
diff --git a/app/views/shared/smart_annotation/_users.html.erb b/app/views/shared/smart_annotation/_users.html.erb index 93eeb0eb1..5034de624 100644 --- a/app/views/shared/smart_annotation/_users.html.erb +++ b/app/views/shared/smart_annotation/_users.html.erb @@ -16,7 +16,7 @@ <% if limit_reached %>
<%= t('atwho.more_results') %>
<% end %> - <% if users.empty? %> + <% if users.blank? %> <%= render partial: 'shared/smart_annotation/no_results.html.erb', locals: { object_type: 'users' } %> <% end %>
diff --git a/app/views/steps/_step.html.erb b/app/views/steps/_step.html.erb index eacb63760..4cc4120f3 100644 --- a/app/views/steps/_step.html.erb +++ b/app/views/steps/_step.html.erb @@ -140,7 +140,7 @@
<% step.checklists.asc.each do |checklist| %> <%= custom_auto_link(checklist.name, team: current_team) %> - <% if checklist.checklist_items.empty? %> + <% if checklist.checklist_items.blank? %>
<%= t("protocols.steps.empty_checklist") %>
diff --git a/app/views/users/confirmations/new.html.erb b/app/views/users/confirmations/new.html.erb index 16650b5ec..9cf728e23 100644 --- a/app/views/users/confirmations/new.html.erb +++ b/app/views/users/confirmations/new.html.erb @@ -20,7 +20,7 @@ -<% if not resource.errors.empty? %> +<% if resource.errors.present? %> <% end %> -<% if @team and not @team.errors.empty? %> +<% if @team && @team.errors.present? %> <% end %> -<% if @team and not @team.errors.empty? %> +<% if @team && @team.errors.present? %>