Rails/SQL/Associations Assignment