Skip to content

Commit

Permalink
Merge pull request #304 from DNNX/bulk-body
Browse files Browse the repository at this point in the history
Simplify Chewy::Type::Import#bulk_body a little
  • Loading branch information
pyromaniac committed Jan 3, 2016
2 parents 9d00319 + 145ead9 commit fa46035
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/chewy/type/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ def bulk options = {}
private

def bulk_body(action_objects, indexed_objects = nil)
action_objects.inject([]) do |result, (action, objects)|
action_objects.flat_map do |action, objects|
method = "#{action}_bulk_entry"
crutches = Chewy::Type::Crutch::Crutches.new self, objects
result.concat(objects.map { |object| send(method, object, indexed_objects, crutches) }.flatten)
objects.flat_map { |object| send(method, object, indexed_objects, crutches) }
end
end

Expand Down

0 comments on commit fa46035

Please sign in to comment.