updates to look like Rails AssociationScope
fix for default ordering by primary key