Skip to content

Commit

Permalink
Replace -> {} with a proc.
Browse files Browse the repository at this point in the history
When `parse_options_for` was called for a command that
hadn't set up any option parsing with `options_for`, the `call` method
would be sent to `-> {}`, which didn't like to be passed two arguments.

Switch to `proc {}` which can accept several arguments.
  • Loading branch information
kaspth committed Dec 5, 2015
1 parent edc3deb commit cb148c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/commands/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def exists?(task_name) # :nodoc:
@@command_options = {}

def parse_options_for(command_name)
@@command_options.fetch(command_name, -> {}).call(@option_parser, @options)
@@command_options.fetch(command_name, proc {}).call(@option_parser, @options)
end

def build_option_parser
Expand Down

0 comments on commit cb148c5

Please sign in to comment.