Permalink
Browse files

Record deletion was not working

  • Loading branch information...
1 parent e78a14c commit 68fed3556e92c324e04e374d6cf6873402e737c0 @mshibuya committed Feb 24, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/rails_admin/adapters/mongoid.rb
@@ -48,11 +48,8 @@ def count(options = {},scope=nil)
all(options.merge({:limit => false, :page => false}), scope).count
end
- def destroy(ids)
- ids = ids.map{|i| BSON::ObjectId(i)}
- destroyed = Array(model.where(:_id.in=>ids))
- model.destroy_all(:conditions=>{:_id.in=>ids})
- destroyed
+ def destroy(objects)
+ Array.wrap(objects).each &:destroy
end
def associations

0 comments on commit 68fed35

Please sign in to comment.