Skip to content
Open
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
6 changes: 4 additions & 2 deletions lib/jbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,11 @@ def _set_value(key, value)
end

def _map_collection(collection)
collection.map do |element|
collection = collection.map do |element|
_scope{ yield element }
end - [BLANK]
end
collection.delete(BLANK)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safe to mutate because the result of the map is local to the method. The input remains unaffected.

collection
end

def _scope
Expand Down