Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@@ -3,7 +3,7 @@ module PostGuardian
# Can the user act on the post in a particular way.
# taken_actions = the list of actions the user has already taken
def post_can_act?(post, action_key, opts={})
def post_can_act?(post, action_key, opts = {})
return false unless can_see_post?(post)
@@ -85,7 +85,7 @@ module PostGuardian
(!SpamRule::AutoBlock.block?(@user) || (!!parent.try(:private_message?) && parent.allowed_users.include?(@user))) && (
!parent ||
!parent.category ||
Category.post_create_allowed(self).where(:id => parent.category.id).count == 1
Category.post_create_allowed(self).where(id: parent.category.id).count == 1
)
end
@@ -186,8 +186,8 @@ module PostGuardian
can_see_post?(post)
end
def can_vote?(post, opts={})
post_can_act?(post,:vote, opts)
def can_vote?(post, opts = {})
post_can_act?(post, :vote, opts)
end
def can_change_post_owner?