support active_record 4 and mongoid 4