Skip to content

Commit

Permalink
rubocopを実行した
Browse files Browse the repository at this point in the history
  • Loading branch information
nakamu-kazu222 committed Nov 25, 2024
1 parent 885582f commit 71d671b
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/models/announcement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/answer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def title
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/searchable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def formatted_updated_at
end

def label
if model_name.name.downcase == 'user'
if model_name.name.casecmp('user').zero?
avatar_url
else
case model_name.name.downcase
Expand Down
2 changes: 1 addition & 1 deletion app/models/correct_answer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def url
end

def formatted_summary(word)
return body unless word.present?
return body if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/practice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def url
end

def formatted_summary(word)
return body unless word.present?
return body if word.blank?

body.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/regular_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/searcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.search(word, document_type: :all)

searchables.map do |searchable|
searchable.instance_variable_set(:@highlight_word, word)

{
url: searchable.try(:url),
title: fetch_title(searchable),
Expand All @@ -50,7 +50,7 @@ def self.search(word, document_type: :all)
}
end
end

def self.fetch_commentable_user(searchable)
if searchable.is_a?(Answer) || searchable.is_a?(CorrectAnswer)
searchable.question&.user
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def url
end

def formatted_summary(word)
return description unless word.present?
return description if word.blank?

description.gsub(/(#{Regexp.escape(word)})/i, '<strong class="matched_word">\1</strong>')
end
Expand Down

0 comments on commit 71d671b

Please sign in to comment.