diff --git a/lib/jbuilder.rb b/lib/jbuilder.rb index 10e4e95..ac4efc3 100644 --- a/lib/jbuilder.rb +++ b/lib/jbuilder.rb @@ -64,15 +64,6 @@ def initialize(*args, &block) options = args.extract_options! @key_formatter = options.fetch(:key_formatter, @@key_formatter.clone) @ignore_nil = options.fetch(:ignore_nil, @@ignore_nil) - - # old-style initialization compatibility - if args.any? - @key_formatter = args.shift - @ignore_nil = args.shift if args.any? - ::ActiveSupport::Deprecation.warn 'Initialization with positioned ' + - 'arguments is deprecated. Use hash syntax instead.' - end - yield self if block end diff --git a/test/jbuilder_test.rb b/test/jbuilder_test.rb index 5eef777..56de888 100644 --- a/test/jbuilder_test.rb +++ b/test/jbuilder_test.rb @@ -457,14 +457,6 @@ def empty? assert_equal 50, parsed['relations'][1]['age'] end - test 'initialize with positioned arguments (deprecated)' do - ::ActiveSupport::Deprecation.silence do - jbuilder = Jbuilder.new(1, 2) - assert_equal 1, jbuilder.instance_eval('@key_formatter') - assert_equal 2, jbuilder.instance_eval('@ignore_nil') - end - end - test 'initialize via options hash' do jbuilder = Jbuilder.new(:key_formatter => 1, :ignore_nil => 2) assert_equal 1, jbuilder.instance_eval('@key_formatter')