1. 23 3月, 2015 19 次提交
  2. 22 3月, 2015 14 次提交
  3. 21 3月, 2015 7 次提交
    • K
      Merge pull request #19444 from prathamesh-sonpatki/fix-typos · 07480fb7
      Kasper Timm Hansen 提交于
      [ci skip] Fix typos in test runner's help output
      07480fb7
    • P
      5b7b4e84
    • P
      Fix typos in test runner's help output · 64eb76ed
      Prathamesh Sonpatki 提交于
      64eb76ed
    • R
      Fix ActiveModel::Errors deprecation messages failing when used on its own · cf7fac7e
      Radan Skoric 提交于
        Deprecation messages in ActiveModel::Errors are using String#squish
      from ActiveSupport but were not explicitly requiring it, causing failures
      when used outside rails.
      cf7fac7e
    • J
      Fix documentation for find_or_create_by · 4364211b
      Joe Van Dyk 提交于
      The code in the comment fails on concurrent inserts if done inside a transaction. 
      
      The fix is to force a savepoint to run so that if the database raises an unique violation exception. Otherwise, you'll get errors like:
      
      ```
         (0.3ms)  BEGIN
        Cart Load (0.5ms)  SELECT  "carts".* FROM "carts"  WHERE "carts"."uuid" = '12345' LIMIT 1
      
      # Another process inserts a cart with uuid of '12345' right now
      
        SQL (4371.7ms)  INSERT INTO "carts" ("created_at", "updated_at", "uuid") VALUES ('2015-03-21 01:05:07.833231', '2015-03-21 01:05:07.833231', '12345') RETURNING "id"  [["created_at", Sat, 21 Mar 2015 01:05:07 PDT -07:00], ["updated_at", Sat, 21 Mar 2015 01:05:07 PDT -07:00], ["uuid", "12345"]]
      PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "carts_uuid_idx1"
      DETAIL:  Key (uuid)=(12345) already exists.
      : INSERT INTO "carts" ("created_at", "updated_at", "uuid") VALUES ('2015-03-21 01:05:07.833231', '2015-03-21 01:05:07.833231', '12345') RETURNING "id"
      
      # Retrying the find
      
        Cart Load (0.8ms)  SELECT  "carts".* FROM "carts"  WHERE "carts"."uuid" = '12345' LIMIT 1
      PG::InFailedSqlTransaction: ERROR:  current transaction is aborted, commands ignored until end of transaction block
      : SELECT  "carts".* FROM "carts"  WHERE "carts"."uuid" = '12345' LIMIT 1
         (0.1ms)  ROLLBACK
      ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR:  current transaction is aborted, commands ignored until end of transaction block
      : SELECT  "carts".* FROM "carts"  WHERE "carts"."uuid" = '12345' LIMIT 1
      ```
      4364211b
    • Y
      a8bf3357
    • A
      Merge pull request #19438 from yui-knk/fix/comment · 92a3c8dc
      Arthur Nogueira Neves 提交于
      [ci skip] Check a result of `valid?` instead of `create`
      92a3c8dc