use activerecord query interface instead of deprecated finder methods