Permalink
Browse files

Allow filtering for ActiveRecord models

  • Loading branch information...
1 parent 1a91f80 commit 13cf59aa3d5186f4967c1c05b70ef43a61e882c8 @rdeshpande committed Jun 6, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/active_admin/mongoid/resource.rb
@@ -11,8 +11,10 @@ def resource_table_name
end
end
- # Disable filters
def add_default_sidebar_sections
+ if resource.ancestors.include?(ActiveRecord::Base)
+ super
+ end
end
end
@@ -33,8 +35,11 @@ def sort_order(chain)
end
end
- # Disable filters
def search(chain)
- chain
+ if scoped_collection.ancestors.include?(ActiveRecord::Base)
+ super(chain)
+ else
+ chain
+ end
end
end

0 comments on commit 13cf59a

Please sign in to comment.