-
Notifications
You must be signed in to change notification settings - Fork 450
Closed
Description
The changes to the Jbuilder initializer (from an options hash to keyword arguments) means that the Jbuilder.encode method no longer works when options are passed to it.
For example:
test "encode forwards options to new" do
Jbuilder.encode(key_formatter: 1, ignore_nil: 2) do |json|
assert_equal 1, json.instance_eval{ @key_formatter }
assert_equal 2, json.instance_eval{ @ignore_nil }
end
endFails with:
Error:
JbuilderTest#test_encode_forwards_options_to_new:
ArgumentError: wrong number of arguments (given 1, expected 0)
lib/jbuilder.rb:16:in 'initialize'
lib/jbuilder.rb:32:in 'Class#new'
lib/jbuilder.rb:32:in 'Jbuilder.encode'
test/jbuilder_test.rb:941:in 'block in <class:JbuilderTest>'
where it previously worked fine in 2.13.0 and earlier.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels