| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Coerce strings in create_join_table.
|
| |
| |
| |
| |
| |
| |
| | |
If you accidentally pass a string and a symbol, this breaks. So
we coerce them both to strings.
Fixes #7715
|
| | |
|
|\ \
| | |
| | | |
Postgresql adapter: fix handling of BC timestamps
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
AR::Base.becomes should not change the STI type
Conflicts:
activerecord/CHANGELOG.md
|
| | |
| | |
| | |
| | | |
If you want to change the STI type too, use AR::Base.becomes! instead
|
| | | |
|
| | | |
|
| | | |
|
|/ / |
|
| |
| |
| | |
The `ActiveRecord::Fixtures::find_table_name` method was removed from "master" almost a year ago, but it was never deprecated. Here it comes back, more dead than alive.
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
actionpack/lib/action_dispatch/routing/redirection.rb
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
`#pluck` can be used on a relation with `select` clause (#7551)
|
| | | |
| | | |
| | | |
| | | | |
Closes #7551
|
|/ / / |
|
| | |
| | |
| | |
| | |
| | | |
Thanks @toretore.
https://github.com/rails/rails/commit/9e4c41c903e8e58721f2c41776a8c60ddba7a0a9#commitcomment-2134706
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Two threads may be in method_missing at the same time. If so, they might
both try to define the same delegator method.
Such a situation probably wouldn't result in a particularly spectacular
bug as one method would probably just be overridden by an identical
method, but it could cause warnings to pop up. (It could be worse if
method definition is non-atomic in a particular implementation.)
(We will also need this mutex shortly anyway, see #8127.)
|
| | | |
|
| | |
| | |
| | |
| | | |
We should not need any `serialized_attributes` checks outside `ActiveRecord::AttributeMethods::Serialization` module.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Most apps upgrading from 3.x will have options for mass assigment in
their application.rb and environments/*.rb config files. Rather than
just raising a NoMethodError when copying the config, this commit
adds a warning message until either the protected_attributes gem
is installed or the relevant config options are removed.
|
| | |
| | |
| | |
| | |
| | | |
These were removed with ActiveRecord::Model in
https://github.com/rails/rails/commit/9e4c41c903e8e58721f2c41776a8c60ddba7a0a9#L15L156
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Rather than just changing it and hoping for the best.
Requested by @jeremy:
https://github.com/rails/rails/commit/ba1544d71628abff2777c9c514142d7e9a159111#commitcomment-2106059
|
|\ \ \
| | | |
| | | | |
:counter_cache option for to support custom named counter caches
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
So that the scope may be a NullRelation and return a result without
executing a query.
Fixes #7928
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fixes #8102.
I couldn't find a nicer way to deal with this than delegate the call to
#scope, which will be a NullRelation when we want it to be.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This allows us to avoid hacks like the "return 0 if owner.new_record?"
in #count (which this commit removes).
Also, the relevant foreign key may actually be present even on a new
owner record, in which case we *don't* want a null relation. This logic
is encapsulated in the #null_scope? method.
We also need to make sure that the CollectionProxy is not 'infected'
with the NullRelation module, or else the methods from there will
override the definitions in CollectionProxy, leading to incorrect
results. Hence the nullify: false option to CollectionAssociation#scope.
(This feels a bit nasty but I can't think of a better way.)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
null relations
For example, the following should not run any query on the database:
Post.new.comments.where(body: 'omg').to_a # => []
Fixes #5215.
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This is already handled by #find, it's a duplicate check, since
find_with_ids is not called from anywhere else.
|
| | | | |
|
| | | | |
|
|/ / / |
|
| | |
| | |
| | |
| | | |
message
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This comment is not valid since that `if` is there to make possible to
do:
remove_index :users, :name
Instead of:
remove_index :users, column: :name
What is a valid use case.
[ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This was there due historical reasons since
7dc45818dc43c163700efc9896a0f3feafa31138 to give the user the
possibility to create unique indexes passing "UNIQUE" as the third
argument
|