| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |/ |
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| | |
Empact/association-bind-values-not-updated-on-save
Fix that a collection proxy could be cached before the save of the owner, resulting in an invalid proxy lacking the owner’s id
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
resulting in an invalid proxy lacking the owner’s id.
Absent this fix calls like: owner.association.update_all to behave unexpectedly because they try to act on association objects where
owner_id is null.
more evidence here: https://gist.github.com/Empact/5865555
```
Active Record 3.2.13
-- create_table(:firms, {:force=>true})
-> 0.1371s
-- create_table(:clients, {:force=>true})
-> 0.0005s
1 clients. 1 expected.
1 clients updated. 1 expected.
```
```
Active Record 4.0.0
-- create_table(:firms, {:force=>true})
-> 0.1606s
-- create_table(:clients, {:force=>true})
-> 0.0004s
1 clients. 1 expected.
0 clients updated. 1 expected.
```
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Why are people assigning booleans to string columns? >_>
We unintentionally changed the behavior on Sqlite3 and PostgreSQL.
Boolean values should cast to the database's representation of true and
false. This is 't' and 'f' by default, and "1" and "0" on Mysql. The
implementation to make the connection adapter specific behavior is hacky
at best, and should be re-visted once we decide how we actually want to
separate the concerns related to things that should change based on the
database adapter.
That said, this isn't something I'd expect to change based on my
database adapter. We're storing a string, so the way the database
represents a boolean should be irrelevant. It also seems strange for us
to give booleans special behavior at all in string columns. Why is
`to_s` not sufficient? It's inconsistent and confusing. Perhaps we
should consider deprecating in the future.
Fixes #17571
|
| | |
|
| |
| |
| |
| | |
fixes #17495
|
| |
| |
| |
| |
| |
| | |
if you specify a default scope on a model, it will break caching. We
cannot predict what will happen inside the scope, so play it safe for
now. fixes #17495
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | | |
Print out a meaningful error when ActiveRecord::ReadOnlyRecord is raised
|
|/ /
| |
| |
| |
| |
| |
| | |
Currently, there is no messages which get printed out. Convoluted system
may have hooks that create other objects in which case we only fail with
no messages. This commit changes this information allowing you to know
which object is the one that actually raised the error.
|
| | |
|
| |
| |
| |
| |
| | |
This makes debugging the generated schema output much easier.
As a side effect it also shaves off 2.5 seconds of test runtime.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
We introduced a performance hit by adding an additional iteration
through a model's attributes on creation. We don't actually need the
values from `Result` to be a hash, we can separate the columns and
values and zip them up ourself during the iteration that we have to do.
|
|\ \
| | |
| | |
| | | |
copy reflection_scopes’s unscoped value when building scope for preloading
|
| | |
| | |
| | |
| | | |
preloading, fixes #11036
|
|\ \ \
| | | |
| | | | |
rake db:create shows underlying error message.
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | | |
Remove unused duplicated method `add_column_position` from AbstractMysqlAdapter.
|
| | | |
| | | |
| | | |
| | | | |
AbstractMysqlAdapter
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Avoid unnecessary allocations and method calls
|
| | | | | |
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
db:fixtures:load"
This reverts commit 482fdad5ef8a73688b50bba3991dd4ef6f286edd.
Fixes #17237.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
We should not behave differently just because a class has a default
scope.
|
| | | |
| | | |
| | | |
| | | | |
This method is still used by `update_all`
|
| | | |
| | | |
| | | |
| | | |
| | | | |
These appear to be implementation relics of times past. They duplicate
the logic in Relation, and are no longer used internally.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Arel specifically handles `SelectManager`, with the same logic we're
currently performing. The AST is `Enumerable`, which Arel looks for
separately now.
|
|\ \ \ \
| | | | |
| | | | | |
Call gsub with a Regexp instead of a String for better performance
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We support this behavior, but have no tests which assert that type
casting actually occurs.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
We need to re-order the bind parameters since the AST returned by the
relation will have the where statement as the first bp, which breaks on
PG.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
MySQL reports the column name as `"MAX(developer_id)"`. PG will report
it as `"max"`
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
It was transitively relying on the vertex model being loaded
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In practical terms, this allows serialized columns and tz aware columns
to be used in wheres that go through joins, where they previously would
not behave correctly. Internally, this removes 1/3 of the cases where we
rely on Arel to perform type casting for us.
There were two non-obvious changes required for this. `update_all` on
relation was merging its bind values with arel's in the wrong order.
Additionally, through associations were assuming there would be no bind
parameters in the preloader (presumably because the where would always
be part of a join)
[Melanie Gilman & Sean Griffin]
|
|\ \ \ \
| | | | |
| | | | | |
Remove redundant substitute index when constructing bind values
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We end up re-ordering them either way when we construct the Arel AST (in order
to deal with rewhere, etc), so we shouldn't bother giving it a number in the
first place beforehand.
|
| |/ / /
|/| | |
| | | |
| | | |
| | | | |
This slightly simplifies the code, and reduces the number of times we
need to iterate over the attributes by one.
|
| | | | |
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
Skip setting sequence on a table create if the value is 0 since it will start the first value at 1 anyway.
This fixes the PG error 'setval: value 0 is out of bounds for sequence vms_id_seq...' encountered when migrating a new DB.
BugzID: 15452,9772,13475,16850
|
| | | |
|