Commit 79a5e5568563d7bff0734df845f8370bf8d4db67
1 parent
9dedafae
Exists in
master
and in
29 other branches
Fixes for acts_as_solr_reloaded
* after_save_reindex works from non-indexed classes
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
vendor/plugins/acts_as_solr_reloaded/lib/acts_as_solr/acts_methods.rb
vendor/plugins/acts_as_solr_reloaded/lib/acts_as_solr/common_methods.rb
... | ... | @@ -30,11 +30,14 @@ module ActsAsSolr #:nodoc: |
30 | 30 | end |
31 | 31 | |
32 | 32 | def solr_batch_add(objects) |
33 | - solr_add Array(objects).map{ |a| a.to_solr_doc } | |
33 | + solr_add objects.map{ |a| a.to_solr_doc } | |
34 | + solr_commit if defined?(configuration) and configuration[:auto_commit] | |
34 | 35 | end |
35 | 36 | |
36 | 37 | def solr_batch_add_association(ar, association) |
37 | - solr_batch_add ar.send(association) | |
38 | + result = ar.send(association) | |
39 | + result = [result] unless result.is_a?(Array) | |
40 | + solr_batch_add result | |
38 | 41 | end |
39 | 42 | |
40 | 43 | # Sends an add command to Solr | ... | ... |