Fix scope for rails 4