Skip to content

Commit

Permalink
Simplify Chewy::Type::Import#bulk_body a little
Browse files Browse the repository at this point in the history
  • Loading branch information
DNNX committed Jan 2, 2016
1 parent 9d00319 commit d7dbaa9
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.map { |object| send(method, object, indexed_objects, crutches) }.flatten
end
end

Expand Down

0 comments on commit d7dbaa9

Please sign in to comment.