ORM agnostic update to #783

ref #783, https://github.com/gregbell/active_admin/commit/aa10436f207d6a90989c417f59dfa13d782a76e9#commitcomment-5957693 and #2545

CC @fred

I haven't tested this too much, but it seems like it should work.

I also don't know if there's any point making it quite this modular, as I haven't used Mongoid enough to know if it runs into similar issues IRT #783.