Skip to content

Commit

Permalink
Merge pull request dewski#28 from tanelj/master
Browse files Browse the repository at this point in the history
Fixed issue where it was impossible to turn off JSON callback wrapping
  • Loading branch information
Garrett Bjerkhoel committed Jul 1, 2012
2 parents 93c314c + 559f8ca commit bf764da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/json_builder/compiler.rb
Expand Up @@ -44,9 +44,9 @@ def generate(*args, &block)
# Returns instance of JSONBuilder::Compiler. # Returns instance of JSONBuilder::Compiler.
def initialize(options={}) def initialize(options={})
@_members = [] @_members = []
@_scope = options[:scope] @_scope = options.fetch(:scope, nil)
@_callback = options[:callback] || true @_callback = options.fetch(:callback, true)
@_pretty_print = options[:pretty] || false @_pretty_print = options.fetch(:pretty, false)


# Only copy instance variables if there is a scope and presence of Rails # Only copy instance variables if there is a scope and presence of Rails
copy_instance_variables_from(@_scope) if @_scope copy_instance_variables_from(@_scope) if @_scope
Expand Down

0 comments on commit bf764da

Please sign in to comment.