updating for rails 4 activerecord query