Permalink
Browse files

Fix fetching by ID and remove debugging.

  • Loading branch information...
1 parent 99362a3 commit e604e4282fd6c054eff84ab6966a1c085fb34dbd Marius Seritan committed with Jan 31, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/rails_admin/adapters/mongoid.rb
@@ -17,7 +17,7 @@ def self.can_handle_model(model)
end
def get(id)
- if object = model.where(:id=>BSON::ObjectId(id))
+ if object = model.where(:_id=>BSON::ObjectId(id)).first
RailsAdmin::AbstractObject.new object
else
nil
@@ -54,9 +54,7 @@ def paginated(options = {})
model.where(options).asc(sort)
end
- found = [page_count, Array(condition.limit(per_page).offset((page-1)*per_page))]
- puts "paginated (#{options.inspect}) => #{found.inspect}"
- found
+ [page_count, Array(condition.limit(per_page).offset((page-1)*per_page))]
end
def create(params = {})

0 comments on commit e604e42

Please sign in to comment.