Commit e3abbf72 by tady

conform to rubocop

parent b5e7af71
......@@ -48,8 +48,6 @@ class PostDecorator < Draper::Decorator
end
def thumbnail_url
if model.body =~ /!\[.+?\]\((.+?)\)/
return $1
end
return Regexp.last_match[1] if model.body =~ /!\[.+?\]\((.+?)\)/
end
end
......@@ -12,7 +12,6 @@
#
class Tag < ActiveRecord::Base
# for tree structure
has_ancestry
......@@ -41,7 +40,6 @@ class Tag < ActiveRecord::Base
order(created_at: :desc).limit(limit)
end)
######################################################################
# Class method
######################################################################
......@@ -70,7 +68,7 @@ class Tag < ActiveRecord::Base
tags_this_month_with_score[tag_id] = this_month_count.to_f / (tags_last_month[tag_id] + 1)
end
sorted = tags_this_month_with_score.sort_by { |k, v| -v }.take(limit).to_h
sorted = tags_this_month_with_score.sort_by { |_k, v| -v }.take(limit).to_h
Tag.find(sorted.keys).to_a.zip(sorted.values).to_h
end
......@@ -80,7 +78,6 @@ class Tag < ActiveRecord::Base
# Instance method
######################################################################
def recent_posts(limit = 30)
posts.recent(limit)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment