From 6e03e0452073eeda77e6dfe66aa31e5ec67a3531 Mon Sep 17 00:00:00 2001 From: Pavel Pravosud Date: Sun, 12 May 2013 13:29:44 +0700 Subject: [PATCH] Removed old initializer that was deprecated long time ago --- lib/jbuilder.rb | 9 --------- test/jbuilder_test.rb | 8 -------- 2 files changed, 17 deletions(-) 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')