| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Fix typo in belongs_to_required_by_default config's CHANGELOG entry [ci...
|
|/ |
|
|\
| |
| | |
Fix documentation for find_or_create_by
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
```
|
|\ \
| | |
| | | |
Check subtype limit before using the default limit
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As described here https://github.com/rails/rails/issues/19420. When
using the Postgres BigInt[] field type the big int value was not being
translated into schema.rb. This caused the field to become just a
regular integer field when building off of schema.rb. This fix will
address this by delegating the limit from the subtype to the Array type.
https://github.com/rails/rails/issues/19420
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix ActiveModel::Errors deprecation messages failing when used on its own
|
| | |/
| |/|
| | |
| | |
| | |
| | | |
Deprecation messages in ActiveModel::Errors are using String#squish
from ActiveSupport but were not explicitly requiring it, causing failures
when used outside rails.
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The previous change 92a3c8dcdf174dab5e8759031b6bbe6cd891fe3c improved
this example, but calling .create + #valid? ends up running validations
twice, and we don't want to showcase that.
Lets use the normal use case of building a new object and calling #save
on it, which is what a basic scaffold with Active Record does.
[ci skip]
|
|\ \
| | |
| | | |
use `Dir.exist?` instead of deprecated `Dir.exists?`
|
| |/ |
|
|\ \
| | |
| | | |
Removed requiring ostruct because its unused
|
| |/ |
|
|\ \
| |/
|/| |
[ci skip] Fix typos in test runner's help output
|
|/ |
|
|\
| |
| | |
[ci skip] Check a result of `valid?` instead of `create`
|
|/ |
|
|
|
|
| |
This reverts commit 044f9ab7a4d6646ddce4560bb83b58cdc0baa751.
|
|
|
|
|
|
| |
Also edited the copy to be more consistent with `rake routes`.
See #19323.
|
|\
| |
| | |
Fix handling of empty X_FORWARDED_HOST header.
|
| |
| |
| |
| |
| |
| | |
Previously, an empty X_FORWARDED_HOST header would cause
Actiondispatch::Http:URL.raw_host_with_port to return nil, causing
Actiondispatch::Http:URL.host to raise a NoMethodError.
|
| | |
|
|\ \
| | |
| | | |
Replace occurences of alias_method_chain with their Module#prepend counterpart
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Thanks @fbernier for suggestion! <3
At this moment we can use Module#prepend in all all cases
except of Range because of the bug [1] in MRI 2.2
[1] https://bugs.ruby-lang.org/issues/10847
|
| |/
|/|
| |
| | |
Strip nils out of default translations. Fixes #19419
|
|\ \
| | |
| | | |
Testing Guide: Change 'girlfriend' to 'partner'
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| | |
Preserving RACK_ENV behavior.
This reverts commit 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing
changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
|
| |
| |
| |
| |
| |
| |
| | |
Preserving RACK_ENV behavior.
This reverts commit b19990c82c6a9beff0cd058dc2ff67894a2f9ea7, reversing
changes made to ac291b76ea770b5795c767f2f74a8d0b33744809.
|
| |
| |
| |
| |
| |
| | |
ActionDispatch::IntegrationTest HTTP request methods will accept only
certain kwargs in the future. This test caused a deprecation warning
when running ActionPack tests. Added `params` and `headers` to fix.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Removing `#build_original_fullpath` because it is no longer
used by the Rails' source code or called in the `#call` method becasue
the previous commit now uses `fullpath` from Rack.
The method was nodoc'ed so it's safe to remove.
NOTE: I did this as a separate commit so if this does cause a problem
with engines etc reverting is easy.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In Rack, `#fullpath` checks if there is a query string and builds the
query correctly:
```
def path
script_name + path_info
end
def fullpath
query_string.empty? ? path : "#{path}?#{query_string}"
end
```
We can utilize this instead of manually building the fullpath because
they are the same result. This also reduces allocations in `#call`
because we don't need `build_original_fullpath` to create the paths and
query strings. We don't need to build `fullpath` twice.
|
| | |
|
|\ \
| | |
| | | |
[Fix Select tag Tests] Test correct use of multiple option for select tag
|
| | | |
|
|\| |
| | |
| | | |
Fix test messages use directly true, false and nil instead of their symbol
|
|/ / |
|
| |
| |
| |
| | |
Fixes #19389.
|
|\ \
| | |
| | | |
Updated MySQL documentation link to MySQL latest version 5.6 everywhere ...
|
|/ /
| |
| |
| | |
skip]
|
|\ \
| | |
| | | |
Updated MySQL documentation link to latest version MySQL 5.6 [ci skip]
|
| | | |
|
|\ \ \
| |_|/
|/| | |
add foreign_key option to result of references column type [ci skip]
|
| | | |
|
|\ \ \
| |_|/
|/| | |
Changelog entry for removal of RACK_ENV fallback
|
| | |
| | |
| | |
| | | |
[ci skip]
|
|\ \ \
| |/ /
|/| | |
Updated MySQL documentation link for STRICT_ALL_TABLES [ci skip]
|
| | | |
|