| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
remove_foreign_key methods
fix tests
|
|\ \ \ \
| | | | |
| | | | | |
Add reversible syntax for change_column_default
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Passing `:from` and `:to` to `change_column_default` makes this command
reversible as user has defined its previous state.
So, instead of having the migration command as:
change_column_default(:posts, :state, "draft")
They can write it as:
change_column_default(:posts, :state, from: nil, to: "draft")
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
This is to show users that they can chain `.uniq` and `.pluck` to get
the `DISTINCT column` result. They don't have to do `DISTINCT column`
themselves.
|
| |/ /
|/| | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | | |
[ci skip] correct for ActiveRecord::Associations::Preloader
|
| | | | |
|
|/ / / |
|
|\ \ \
| | | |
| | | |
| | | | |
Fix `undefined method uncached` for polymorphic belongs_to #20426
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Unitialized polymorphic `belongs_to` associations raise an error while
attempting to reload, as they attempt to make an uncached reload, but
don't have a klass to fetch uncachedly. In this case, `loaded?` should
be `false` anyway.
|
| |/ /
|/| |
| | |
| | |
| | | |
for a namespaced association
fixes #20541
|
| | |
| | |
| | |
| | |
| | | |
This is a small refactoring that simplifies the Active Record specific
lenght validator.
|
| | | |
|
| | |
| | |
| | |
| | | |
Associated objects that were marked for destruction are considered absent.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After discussing, we've decided it makes more sense to include it. We're
already forwarding every conflicting method to `to_a`, and there's no
conflation of concerns. `Enumerable` has no mutating methods, and it
just allows us to simplify the code. No existing methods will have a
change in behavior. Un-overridden Enumerable methods will simply
delegate to `each`.
[Sean Griffin & bogdan]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This matches our behavior in other cases where useful enumerable methods
might have a different definition in `Relation`. Wanting to actually
enumerate over the records in this case is completely reasonable, and
wanting `.sum` is reasonable for the same reason it is on `Enumerable`
in the first place.
|
|\ \ \
| | | |
| | | |
| | | | |
Update documentation for ActiveRecord::Migration#remove_index
|
| | | |
| | | |
| | | |
| | | | |
`remove_index` works with multiple column names as `add_index`
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Let WITH (CTE) queries be explainable
Conflicts:
activerecord/CHANGELOG.md
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
Fixes #20626
|
| | | | |
| | | | |
| | | | |
| | | | | |
revert create and drop task descriptions
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
relationship without the foreign key attribute
fixes regression reported on #20253
ActiveRecord::Base#[] was not used cause of 8b95420
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
db:reset should not prematurely load the environment, so, for instance,
if there is any initializer that touches th DB, it will not touch that
before droping it.
Also this makes the code simpler.
This changed was made back in 15fb4302b6ff16e641b6279a3530eb8ed97f2899
, not sure why. But I am pretty much sure we should do it like this, as
drop and setup should load its dependencies tasks if necessary.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
make sure to load_config for db:abort_if_pending_migrations
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This used to raise a `IrreversibleMigration` error (since #10437).
However since `remove_index :table, :column` is probably the most basic
use-case we should make it reversible again.
Conflicts:
activerecord/CHANGELOG.md
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Add RDoc about add_reference to ActiveRecord::Migration
[ci skip]
|
| | |_|_|/ /
| |/| | | |
| | | | | |
| | | | | | |
[ci skip]
|
| | | | | | |
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | | |
My impression of the code sample is that the intent is to assign guy_1, guy_2, etc. The code as it stood would have assigned guy_1, guy_1, etc.
This simply replaces the 1 with the iterator variable i.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The examples now take in consideration when Active Record finds inverse
associations automatically.
|
| | | | | |
|
| | | | |
| | | | |
| | | | | |
the test case for this commit is in cd3f5db
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If a getter has side effects on the DB, `changes_applied` will be called
twice. The second time will try and remove the changed attributes cache,
and will crash because it's already been unset. This also demonstrates
that we shouldn't assume that calling getters won't change the value of
`changed_attributes`, and we need to clear the cache if an attribute is
modified.
Fixes #20531.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Make remove_foreign_key reversible
Conflicts:
activerecord/CHANGELOG.md
|
| | | | | | |
|
|/ / / / /
| | | | |
| | | | |
| | | | | |
Fixes #17511 and #17415
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If the subtype provides custom schema dumping behavior, we need to defer
to it. We purposely choose not to handle any values other than an array
(which technically should only ever be `nil`, but I'd rather code
defensively here).
Fixes #20515.
|
| | | | |
| | | | |
| | | | |
| | | | | |
change AR clear order in ActionDisplatch::Reloader hook
|
|\ \ \ \ \
| | | | | |
| | | | | | |
refactor ActiveRecord's #become by removing not needed code
|
| | | | | | |
|
|/ / / / / |
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
Fix crash when loading fixture with belongs_to association defined in abstract base class
|
| | | | |
| | | | |
| | | | |
| | | | | |
abstract base class.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Stop `to_s(:db)` for fixture's timestamp
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Time instance will be casted so we don't have to do `to_s(:db)`.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Return a `Point` object from the PG Point type
|