Apply Layout/SpaceInLambdaLiteral rubocop rule
I had mixed feelings about this rule, since I like spaces where
possible.
However, I changed my mind when I realized writing `->(thing) { }` was
similar to defining a method, and we don't have a space before the
parenthesis when defining a method.
This commit is contained in:
@@ -9,7 +9,7 @@ class Poll::PartialResult < ApplicationRecord
|
||||
validates :question, presence: true
|
||||
validates :author, presence: true
|
||||
validates :answer, presence: true
|
||||
validates :answer, inclusion: { in: -> (a) { a.question.possible_answers }},
|
||||
validates :answer, inclusion: { in: ->(a) { a.question.possible_answers }},
|
||||
unless: ->(a) { a.question.blank? }
|
||||
validates :origin, inclusion: { in: VALID_ORIGINS }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user