mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add rubocop to our build. (#5004)
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user