make scope activerecord 4.1 compatible