Skip to content

Commit

Permalink
Use RSolr::Array.wrap consistently in RSolr::Xml
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer authored and jcoyne committed Sep 5, 2017
1 parent c042518 commit 916b072
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rsolr/xml.rb
Expand Up @@ -71,7 +71,7 @@ def build &block
#
def add data, add_attrs = nil, &block
add_attrs ||= {}
data = [data] unless data.is_a?(Array)
data = RSolr::Array.wrap(data)
build do |xml|
xml.add(add_attrs) do |add_node|
data.each do |doc|
Expand Down Expand Up @@ -104,7 +104,7 @@ def rollback
# generates a <delete><id>ID</id></delete> message
# "ids" can be a single value or array of values
def delete_by_id ids
ids = [ids] unless ids.is_a?(Array)
ids = RSolr::Array.wrap(ids)
build do |xml|
xml.delete do |delete_node|
ids.each do |id|
Expand All @@ -117,7 +117,7 @@ def delete_by_id ids
# generates a <delete><query>ID</query></delete> message
# "queries" can be a single value or an array of values
def delete_by_query(queries)
queries = [queries] unless queries.is_a?(Array)
queries = RSolr::Array.wrap(queries)
build do |xml|
xml.delete do |delete_node|
queries.each { |query| delete_node.query(query) }
Expand Down

0 comments on commit 916b072

Please sign in to comment.