Skip to content

Commit

Permalink
Removed old initializer that was deprecated long time ago
Browse files Browse the repository at this point in the history
  • Loading branch information
rwz committed May 12, 2013
1 parent 57e30e4 commit 6e03e04
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
9 changes: 0 additions & 9 deletions lib/jbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 0 additions & 8 deletions test/jbuilder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 6e03e04

Please sign in to comment.