BeautifyRuby
BeautifyRuby copied to clipboard
keeps indenting if a json hash formatted keyword is used
before_save O.new("v"),
if: Proc.new { |p| [154, 1217].include?(p.account_id) }
after_save O.new("v"),
if: Proc.new { |p| [154, 1217].include?(p.account_id) }
after_find O.new("v"),
if: Proc.new { |p| p.attributes.include?("v") && [154, 1217].include?(p.account_id) }
becomes:
before_save O.new("v"),
if: Proc.new { |p| [154, 1217].include?(p.account_id) }
after_save O.new("v"),
if: Proc.new { |p| [154, 1217].include?(p.account_id) }
after_find O.new("v"),
if: Proc.new { |p| proposal.attributes.include?("v") && [154, 1217].include?(p.account_id) }
the top code block is correct.
I think it's seeing the "if" keywoard, and just auto-indenting the line without looking at what if is
a condition starting with if: isn't actually valid.
:+1: