Skip to content

Commit

Permalink
style: codeclimate fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-mesnilgrente committed Aug 14, 2024
1 parent 5fbd5ce commit 39d8f01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/helpers/parsers_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def link_to_next(parser_id, index, environment, review, html_options = {})
def link_to_previous(parser_id, index, environment, review, html_options = {})
index = index.to_i - 1
path = previews_path(
parser_id: :parser_id,
parser_id: parser_id,
index: index,
environment: environment,
review: review
Expand All @@ -62,8 +62,7 @@ def link_to_previous(parser_id, index, environment, review, html_options = {})
def environment_tags(version, parser)
content_tag(:div, class: 'version-tag-container') do
bubbles = []
version.tags ||= []
version.tags.each do |environment|
(version.tags ||= []).each do |environment|
label = environment.capitalize.first
arrow = nil
classes = ['version-tag', environment]
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/versioned.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def last_edited_by
end

def current_version(environment)
return versions.last if environment.to_sym == :test || environment.to_sym == :preview
return versions.last if environment.to_sym.in? [:test, :preview]
versions.where(tags: environment.to_s).desc(:created_at).first
end

Expand Down
3 changes: 2 additions & 1 deletion app/models/harvest_schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def find_from_environment(params, env)

def destroy_all_for_parser(parser_id)
environments = APPLICATION_ENVS
environments = [Rails.env] if ['development', 'test'].include? Rails.env
rails_env = Rails.env
environments = [rails_env] if ['development', 'test'].include? rails_env

environments.each do |env|
HarvestSchedule.find_from_environment({ parser_id: parser_id }, env).each do |hs|
Expand Down

0 comments on commit 39d8f01

Please sign in to comment.