lib/hydra/batch_edit_behavior.rb in hydra-batch-edit-0.0.4 vs lib/hydra/batch_edit_behavior.rb in hydra-batch-edit-0.0.5

- old
+ new

@@ -65,22 +65,32 @@ clear_batch! redirect_to catalog_index_path end + def all + self.batch = Hydra::BatchEdit::SearchService.new(session, current_user.user_key).last_search_documents.map(&:id) + redirect_to edit_batch_edits_path + end + protected def batch session[:batch_document_ids] ||= [] end + def batch=(val) + session[:batch_document_ids] = val + end + + def clear_batch! - session[:batch_document_ids] = [] + self.batch = [] end def check_for_empty! if batch.empty? - redirect_to catalog_index_path + redirect_to :back return false end end def filter_docs_with_access!