-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
@vlad-pisanov
Description
Model hooks and controller filters that receive if: and unless: lambdas can be written more succinctly using symbols if the lambda consists of a single method call. This cop would enforce either style consistently based on configuration.
# bad before_save :log, if: -> { name_changed? } around_destroy :baz, if: -> (user) { user.new? } after_action :foo, unless: -> { self.bar? } # good before_save :log, if: :name_changed? around_destroy :baz, if: :new? after_action :foo, unless: :bar?
Metadata
Metadata
Assignees
Labels
No labels