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

Add #create_or_find_by to lean on unique constraints #31989

Merged
merged 7 commits into from
Feb 15, 2018
Merged

Commits on Feb 13, 2018

  1. Configuration menu
    Copy the full SHA
    744e37a View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2018

  1. Raise an exception if no record can be found

    Better than nil.
    dhh committed Feb 14, 2018
    Configuration menu
    Copy the full SHA
    ee7a453 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cde5208 View commit details
    Browse the repository at this point in the history
  3. Require new transaction in case unique constraint causes rollback

    Otherwise PG will complain with "PG::InFailedSqlTransaction: ERROR:  current transaction is aborted, commands ignored until end of transaction block".
    
    Thanks @matthewd
    dhh committed Feb 14, 2018
    Configuration menu
    Copy the full SHA
    03374e9 View commit details
    Browse the repository at this point in the history
  4. Documentation fixes

    Thanks @tjschuck
    dhh committed Feb 14, 2018
    Configuration menu
    Copy the full SHA
    0768324 View commit details
    Browse the repository at this point in the history
  5. Add changelog entry

    dhh committed Feb 14, 2018
    Configuration menu
    Copy the full SHA
    72cbe0c View commit details
    Browse the repository at this point in the history
  6. Remove trailing whitespace

    dhh committed Feb 14, 2018
    Configuration menu
    Copy the full SHA
    ba45394 View commit details
    Browse the repository at this point in the history