Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask Connection to quote symbolic column names when building ORDER BY #5029

Closed
wants to merge 1 commit into from

Commits on Feb 13, 2012

  1. Ask Connection to quote symbolic column names when building ORDER BY …

    …clauses.
    
    In some databases (e.g, mysql) column names referenced in ORDER BY clauses
    should be quoted in case they contain reserved words. This corrects an issue that
    occurs when using the Model.order(:symbol) method if :symbol happens to be a reserved
    word (e.g., "key").
    
    Most AR methods handle this correctly, so calling Model.where(:key) would not fail
    but Model.order(:key) would.
    
    This problem was originally reported as issue rails#2601.
    rdlugosz committed Feb 13, 2012
    Configuration menu
    Copy the full SHA
    c586e0c View commit details
    Browse the repository at this point in the history