Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions lib/jbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ def set!(key, value = BLANK, *args, &block)
_set_value key, result
end

def method_missing(*args, &block)
if ::Kernel.block_given?
set!(*args, &block)
else
set!(*args)
end
end

# Specifies formatting to be applied to the key. Passing in a name of a function
# will cause that function to be called on the key. So :upcase will upper case
# the key. You can also pass in lambdas for more complex transformations.
Expand Down Expand Up @@ -283,6 +275,8 @@ def target!

private

alias_method :method_missing, :set!

def _extract(object, attributes)
if ::Hash === object
_extract_hash_values(object, attributes)
Expand Down
2 changes: 2 additions & 0 deletions lib/jbuilder/jbuilder_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def set!(name, object = BLANK, *args)

private

alias_method :method_missing, :set!

def _render_partial_with_options(options)
options.reverse_merge! locals: options.except(:partial, :as, :collection, :cached)
options.reverse_merge! ::JbuilderTemplate.template_lookup_options
Expand Down