[SOLVED] How to deal with "C: Align the operands of a condition in an unless statement spanning multiple lines" error from Rubocop
Below is the problem statement.C: Align the operands of a condition in an unless statement spanning multiple lines
Rubocop throws this as an error when the operands are not align correctly.Below the simpler way to look at it and how to resolve it.Solution:Related Articles
@bad CodeGet Amazon Gift Cards for your friends and relatives: herefail('Title not Present') unless@good Code
NewPage.page.title1.exists? ||
NewPage.page.title2.exists?fail('Title not Present') unless
NewPage.page.title1.exists? ||
NewPage.page.title2.exists?
This post first appeared on G33K-TRICKS - Your Source To Tips And Tricks, please read the originial post: here