| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Add validate_constraint and update naming
|
|\
| |
| |
| |
| | |
gregnavis/support-postgresql-operator-classes-in-indexes
Add support for PostgreSQL operator classes to add_index
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add support for specifying non-default operator classes in PostgreSQL
indexes. An example CREATE INDEX query that becomes possible is:
CREATE INDEX users_name ON users USING gist (name gist_trgm_ops);
Previously it was possible to specify the `gist` index but not the
custom operator class. The `add_index` call for the above query is:
add_index :users, :name, using: :gist, opclasses: {name: :gist_trgm_ops}
|
| | |
|
| |
| |
| |
| |
| | |
making changes (#31306)
It makes more sense than ignoring invalid IDs.
|
|/
|
|
|
|
|
|
|
|
|
| |
In 35836019, class level `update` and `destroy` suppressed
`RecordNotFound` to ensure returning affected objects. But
`RecordNotFound` is a common exception caught by a `rescue_from`
handler. So changing the behavior when a typical `params[:id]` is passed
has a compatibility problem. The previous behavior should not be
changed.
Fixes #31301.
|
|\
| |
| |
| |
| | |
chopraanmol1/bug_fix_has_one_inverse_owner_reload_from_validation
Inverse instance should not be reloaded during autosave if called in validation
|
| |
| |
| |
| |
| | |
Record saved in save_has_one_association already make call to association.loaded! via record's before_save callback of save_belongs_to_association,
but this will reload object if accessed in record's validation.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Due to inconsistent behavior when chaining scopes and one scope named after a Relation method
Validation code added in 2 places:
- scope, to prevent problematic scope names.
- enum, cause it tries to auto define scope.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
statement due to user request (#31235)
This changes `StatementTimeout` to `QueryCanceled` for PostgreSQL.
In MySQL, errno 1317 (`ER_QUERY_INTERRUPTED`) is only used when the
query is manually cancelled.
But in PostgreSQL, `QUERY_CANCELED` error code (57014) which is used
`StatementTimeout` is also used when the both case. And, we can not tell
which reason happened.
So I decided to introduce new error class `QueryCanceled` closer to the
error code name.
|
| |
| |
| |
| |
| |
| | |
Since #31129, new error class `StatementTimeout` has been added.
`TransactionTimeout` is caused by the timeout shorter than
`StatementTimeout`, but its name is too generic. I think that it should
be a name that understands the difference with `StatementTimeout`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
rails/kamipo/ordinal_methods_should_respect_loaded_records"
This reverts commit 0f79ab91150b4cdb6c018530978a3395962c7a02, reversing
changes made to d575f7f2e737739302a0e8210d01c10f5d4e2c35.
This PR philosophically conflicts with #30800 and Matthew thinks we
should hold off merging this until we find concensus. Reverting since
we're about to cut a release for 5.2.
|
|\ \
| | |
| | | |
Flush idle database connections
|
| |/ |
|
|\ \
| | |
| | | |
Provide arguments to RecordNotFound
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
rails/kamipo/ordinal_methods_should_respect_loaded_records
Ordinal methods should respect loaded records
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We should reset partially loaded `@offsets` cache when latest records
has loaded because the cache has been staled and it may not be
consistent with latest records.
|
|\ \ \ \
| |_|_|/
|/| | | |
Improve AR connection fork safety
|
| | |/
| |/|
| | |
| | |
| | |
| | | |
Use whatever adapter-provided means we have available to ensure forked
children don't send quit/shutdown/goodbye messages to the server on
connections that belonged to their parent.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
test_read_attributes_before_type_cast_on_a_boolean
https://github.com/jruby/activerecord-jdbc-adapter ActiveRecord JDBC Adapter is actively developed
and it supports Rails 5.1 now. This pull request addresses one of the failure when running
ActiveRecord unit tests with ActiveRecord JDBC Adapter.
As of right now, ActiveRecord JDBC Adapter supports Rails 5.1, not master branch
then this test only can run on `5-1-stable` branch. But I have opened this pull request to `master` branch
since this type cast should be going to work in the future versions of ActiveRecord JDBC Adapter .
```ruby
$ ARCONN=jdbcmysql bin/test test/cases/attribute_methods_test.rb:203
Using jdbcmysql
Run options: --seed 8874
F
Finished in 0.709120s, 1.4102 runs/s, 1.4102 assertions/s.
1) Failure:
AttributeMethodsTest#test_read_attributes_before_type_cast_on_a_boolean [/home/yahonda/git/rails/activerecord/test/cases/attribute_methods_test.rb:203]:
Expected: "0"
Actual: 0
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
$
```
|
|\ \ \
| | | |
| | | | |
Switch to LIFO for the connection pool
|
| | | | |
|
| | | | |
|
|\ \ \ \
| |_|/ /
|/| | | |
Enable query cache on all connection pools
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Since the query cache no longer eagerly checks out a connection, we can
enable it on all connection pools at the start of every request, and it
will only take effect for requests that actually use those pools.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
insensitive
i.e. Oracle database identifier is UPPERCASE unlike other databases.
```ruby
(byebug) query = Developer.all.to_sql
"SELECT \"DEVELOPERS\".\"ID\", \"DEVELOPERS\".\"NAME\", \"DEVELOPERS\".\"SALARY\", \"DEVELOPERS\".\"FIRM_ID\", \"DEVELOPERS\".\"MENTOR_ID\", \"DEVELOPERS\".\"CREATED_AT\", \"DEVELOPERS\".\"UPDATED_AT\", \"DEVELOPERS\".\"CREATED_ON\", \"DEVELOPERS\".\"UPDATED_ON\" FROM \"DEVELOPERS\""
```
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`oldie = 'true'` to `tinyint(1)` column is invalid value for MySQL:
```
Mysql2::Error: Incorrect integer value: 'true' for column 'oldie' at row 1: update horses set oldie = 'true'
```
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Add a #populate method to migrations
* Address rubocop issues
* Rename to #up_only and use #execute in the examples intead of the model
* Update CHANGELOG
[Rich Daley & Rafael Mendonça França]
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Disallow raw SQL in dangerous AR methods
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
with Arel SQL literator which overrides #concat
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The documentation claims that given values go through "normal AR type
casting and serialization", which to me implies
`serialize(cast(value))`, not just serialization. The docs were changed
to use this wording in #22492. The tests I cited in that PR (which is
the same test modified in this commit), is worded in a way that implies
it should be using `cast` as well.
It's possible that I originally meant "normal type casting" to imply
just the call to `serialize`, but given that `update_all(archived:
params['archived'])` seems to be pretty common, I'm inclined to make
this change as long as no tests are broken from it.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Do not use `Arel.star` when `ignored_columns`
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If there are any ignored columns, we will now list out all columns we
want to be returned from the database.
Includes a regression test.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
timeout exceeded (#31129)
We are sometimes using The MAX_EXECUTION_TIME hint for MySQL depending
on the situation. It will prevent catastrophic performance down by wrong
performing queries.
The new error class `StatementTimeout` will make to be easier to handle
that case.
https://dev.mysql.com/doc/refman/5.7/en/optimizer-hints.html#optimizer-hints-execution-time
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Follow up of #30360.
|
| | | | | | |
|