fix logged in status scopes
rewrite find_with_case in mongo query
rewrite sql construction with mongoid criteria
rewrite finder method with mongoid query
fix session maintenance module for mongoid document