This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
8
line too long rubocop
Post Body
good day reddit. I am having trouble to break this line of code to pass rubocop.
how can I break the line? If I use if conditional inside can, rubocop recommends guard clause instead.
can :manage, [DepartmentCode, DepartmentGroupCode, AreaCode] if accounting_head(user)
EDIT: Thank you all for your reply. I ended up using the suggestion of @brainbag
return false unless accounting_head(user)
can :manage, [DepartmentCode, DepartmentGroupCode, AreaCode]
Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
5,078
Link Karma
2,929
Comment Karma
2,082
Profile updated: 3 days ago
Posts updated: 10 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/rails/comme...