| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Dont cache the conn_spec_name when empty
|
| |
| |
| |
| |
| |
| |
| |
| | |
We cannot cache the connection_specification_name when it doesnt
exist. Thats because the parent value could change, and we should keep
failling back to the parent. If we cache that in a children as an ivar,
we would not fallback anymore in the next call, so the children would
not get the new parent spec_name.
|
|/
|
|
|
|
| |
`remove_connection` can reset the `connection_specification_name`, so we
need to to set it after the remove_connection call on
`establish_connection` method.
|
|
|
|
|
|
|
|
| |
Follow up of #24844.
The key of `@owner_to_pool` was changed from `klass.name` to
`spec.name`. By this change "memory leaks in development mode"
will not happen, bacause the equality of string is not changed
by reloading of model files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
remove_connection
When calling `remove_connection` on a model, we delete the pool so we also
need to reset the `connection_specification_name` so it will fallback to
the parent.
This was the current behavior before rails 5, which will fallback to the
parent connection pool.
[fixes #24959]
Special thanks to @jrafanie for working with me on this fix.
|
|\
| |
| | |
Should quote `lock_name` to pass to `get_advisory_lock`
|
| | |
|
|\ \
| |/
|/| |
Replacement cycle for readability
|
| | |
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
Some slight documentation edits and fixes. Also, run remove unnecessary
`RuntimeError`.
r? @arthurnn
|
| |
|
|\
| |
| | |
Refactor connection handler
|
| |
| |
| |
| | |
[skip ci]
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ConnectionHandler will not have any knowlodge of AR models now, it will
only know about the specs.
Like that we can decouple the two, and allow the same model to use more
than one connection.
Historically, folks used to create abstract AR classes on the fly in
order to have multiple connections for the same model, and override the
connection methods.
With this, now we can override the `specificiation_id` method in the
model, to return a key, that will be used to find the connection_pool
from the handler.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In 5.0 we use bind parameters for limit and offset, while in 4.2 we used
the values directly. The code as it was written assumed that limit and
offset worked as `LIMIT ? OFFSET ?`. Both Oracle and SQL Server have a
different syntax, where the offset is stated before the limit. We
delegate this behavior to the connection adapter so that these adapters
are able to determine how the bind parameters are flattened based on
what order their specification has the various clauses appear.
Fixes #24775
|
|\ \
| | |
| | | |
Change to use a more realistic example [ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
destroy_all is preferred way to destroy related records.
This example just wants to demonstrate callback behaviour.
[ci skip]
|
|\ \ \
| |/ /
|/| | |
delegate encode_with instead of to_yaml, which is deprecated
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
After fb898e9, the `before_destroy` had some code that used
SQL interpolation left over. Don't think we should promote
that even if the values aren't directly from user input.
|
|\ \ \
| |_|/
|/| | |
do not pass conditions to `#destroy_all` [ci skip]
|
| |/
| |
| |
| | |
Passing conditions to `#destroy_all` was deprecated in c82c5f8.
|
|/
|
|
| |
[ci skip]
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Unlike `one?` and `none?`, `empty?` has interactions with methods
outside of enumerable. It also doesn't fit in the same vein.
`Topic.any?` makes sense. `Topic.empty?` does not, as `Topic` is not a
container.
Fixes #24808
Close #24812
|
|
|
|
|
|
|
| |
`schema_creation` is not public API.
https://github.com/rails/rails/blob/v5.0.0.beta4/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L121
https://github.com/rails/rails/blob/v5.0.0.beta4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L78
|
|\
| |
| |
| |
| | |
Fix counter_cache double increment bug
Close #24183
|
| | |
|
| |
| |
| |
| |
| | |
Rails should not be explicity mentioned within Active Record, since
railties and the Rails ecosystem is not required for use.
|
| |
| |
| |
| |
| |
| | |
Refactor of #22911.
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
|
| |
| |
| |
| |
| |
| | |
Follow up of 1683410.
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
|
| |
| |
| |
| |
| |
| |
| | |
`ActiveRecord::Migration` needn't know about migration version
compatibility lookup. Delegate it to the Compatibility module.
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
guides/source/configuring.md
|
| | | |
|
| | |
| | |
| | |
| | | |
[ci skip]
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, loading the schema (schema_load)
accesses the locking column (locking_column)
which defaults the value (reset_locking_column)
which invalidates the schema (reload_schema_from_cache)
which forces another schema load.
Good news:
The second schema_load does accesses locking_column,
but locking_column is set, so it does not reset_locking_column
and it does not trigger an infinite loop.
The solution is not invalidate the cache while default locking_column
|
| | |
|
|\ \
| | |
| | | |
Move remaining current_savepoint_name to savepoints module
|
| | | |
|