| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
`default_proc` makes a hash unmarshallable, and adds unneccessary
overhead. Since we control all access to the hash, let's just handle it
in that method. This has the side effect of improving performance on
initialization (but not neccessarily on access). We'll need to profile
further once the tests are passing.
|
| |
| |
| |
| |
| |
| |
| | |
In real usage, we give the builder a types hash with a default value of
`Type::Value.new`. This means we need to explicitly check for the key,
rather than the truthiness of the type to determine if it's a known but
uninitialized attribute
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We don't know which attributes will or won't be used, and we don't want
to create massive bottlenecks at instantiation. Rather than doing *any*
iteration over types and values, we can lazily instantiate the object.
The lazy attribute hash should not fully implement hash, or subclass
hash at any point in the future. It is not meant to be a replacement,
but instead implement its own interface which happens to overlap.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 8fee923888192a658d8823b31e77ed0683dfd665.
Conflicts:
activerecord/lib/active_record/attribute_set/builder.rb
This solution sucks, and is hard to actually apply across the board.
Going to try other solutions
|
| |
| |
| |
| | |
There is a significant performance difference between the two. Closes
|
| |
| |
| |
| |
| | |
also increase the version of pg required so that people will get the
GVL friendly version
|
| | |
|
|\ \
| | |
| | |
| | | |
add a Table#name accessor like TableDefinition#name
|
| | | |
|
|\ \ \
| |/ /
|/| | |
remove never called method `limited_update_conditions`
|
| |/ |
|
|\ \
| | |
| | | |
Tiny improvement in sqlite3 adapter
|
| |/
| |
| |
| |
| | |
- remove unused method `supports_add_column?`
- change additional restriction method to `valid_alter_table_type?`
- fix code style
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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 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"`
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|