We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83ce6e3 commit a134eebCopy full SHA for a134eeb
activesupport/lib/active_support/core_ext/object/with_options.rb
@@ -92,10 +92,10 @@ class Object
92
def with_options(options, &block)
93
option_merger = ActiveSupport::OptionMerger.new(self, options)
94
95
- if block.nil?
96
- option_merger
97
- else
+ if block
98
block.arity.zero? ? option_merger.instance_eval(&block) : block.call(option_merger)
+ else
+ option_merger
99
end
100
101
0 commit comments