Commit e3abbf72 by tady

conform to rubocop

parent b5e7af71
...@@ -48,8 +48,6 @@ class PostDecorator < Draper::Decorator ...@@ -48,8 +48,6 @@ class PostDecorator < Draper::Decorator
end end
def thumbnail_url def thumbnail_url
if model.body =~ /!\[.+?\]\((.+?)\)/ return Regexp.last_match[1] if model.body =~ /!\[.+?\]\((.+?)\)/
return $1
end
end end
end end
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
# #
class Tag < ActiveRecord::Base class Tag < ActiveRecord::Base
# for tree structure # for tree structure
has_ancestry has_ancestry
...@@ -41,7 +40,6 @@ class Tag < ActiveRecord::Base ...@@ -41,7 +40,6 @@ class Tag < ActiveRecord::Base
order(created_at: :desc).limit(limit) order(created_at: :desc).limit(limit)
end) end)
###################################################################### ######################################################################
# Class method # Class method
###################################################################### ######################################################################
...@@ -70,7 +68,7 @@ class Tag < ActiveRecord::Base ...@@ -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) tags_this_month_with_score[tag_id] = this_month_count.to_f / (tags_last_month[tag_id] + 1)
end 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 Tag.find(sorted.keys).to_a.zip(sorted.values).to_h
end end
...@@ -80,7 +78,6 @@ class Tag < ActiveRecord::Base ...@@ -80,7 +78,6 @@ class Tag < ActiveRecord::Base
# Instance method # Instance method
###################################################################### ######################################################################
def recent_posts(limit = 30) def recent_posts(limit = 30)
posts.recent(limit) posts.recent(limit)
end 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