Skip to content

Commit

Permalink
Remove scope from mongoid bulk queries
Browse files Browse the repository at this point in the history
  • Loading branch information
lapluviosilla committed Apr 7, 2011
1 parent 6dd54a4 commit cd379d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/rails_admin/main_controller.rb
Expand Up @@ -162,8 +162,8 @@ def bulk_delete
def bulk_destroy
@authorization_adapter.authorize(:bulk_destroy, @abstract_model) if @authorization_adapter

scope = @authorization_adapter && @authorization_adapter.query(params[:action].to_sym, @abstract_model)
@destroyed_objects = @abstract_model.destroy(params[:bulk_ids], scope)
#scope = @authorization_adapter && @authorization_adapter.query(params[:action].to_sym, @abstract_model)
@destroyed_objects = @abstract_model.destroy(params[:bulk_ids])

@destroyed_objects.each do |object|
message = "Destroyed #{@model_config.with(:object => object).object_label}"
Expand All @@ -187,9 +187,9 @@ def handle_error(e)
private

def get_bulk_objects
scope = @authorization_adapter && @authorization_adapter.query(params[:action].to_sym, @abstract_model)
#scope = @authorization_adapter && @authorization_adapter.query(params[:action].to_sym, @abstract_model)
@bulk_ids = params[:bulk_ids]
@bulk_objects = @abstract_model.get_bulk(@bulk_ids, scope)
@bulk_objects = @abstract_model.get_bulk(@bulk_ids)

not_found unless @bulk_objects
end
Expand Down

0 comments on commit cd379d9

Please sign in to comment.