Add more ActionRecord query Logic