default_scope for select option generates incorrect MySQL syntax

This patch

https://rails.lighthouseapp.com/projects/8994/tickets/2626

fixes and error when you use select option in default_scope