AR::Relation#scoped has been removed in favor of #scope, which works on both AR 4.0 and 4.1.