| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
This is a follow up to #13926.
/cc @fxn
|
| |
|
| |
|
|
|
|
|
|
| |
Since its conception arel was made to be private API of Active Record.
If users want to use arel features directly we should provide a way
using the Active Record API without exposing the arel implementation.
|
|\
| |
| |
| |
| |
| |
| | |
PostgreSQL implementation of SchemaStatements#index_name_exists?
Conflicts:
activerecord/CHANGELOG.md
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Associations now raises `ArgumentError` on name conflicts. Closes #13217.
|
| | |
| | |
| | |
| | |
| | | |
Dangerous association names conflicts include instance or class
methods already defined by `ActiveRecord::Base`.
|
|/ / |
|
|\ \
| | |
| | | |
Let `unscope` ignore non Arel scope.where_values
|
| | | |
|
|\ \ \
| |/ /
|/| | |
Fix regression on .select method
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This was a common pattern:
```
query = author.posts.select(:title)
connection.select_one(query)
```
However `.select` returns a ActiveRecord::AssociationRelation, which has
the bind information, so we can use that to get the right sql query.
Also fix select_rows on postgress and sqlite3 that were not using the binds
[fixes #7538]
[fixes #12017]
[related #13731]
[related #12056]
|
| | |
| | |
| | |
| | |
| | |
| | | |
This behavior is only work out-of-box with minitest and also add a
downside to run after each test case, even if we don't used the travel
or travel_to methods
|
|\ \ \
| | | |
| | | | |
find_in_batches should not mutate its argument
|
| | | | |
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | | |
There is no gain in `referencing` tables that are not used for preloading.
Furthermore it will break if polymorphic associations are invloved. This
is because `references_eager_loaded_tables?` uses all `reference_values`
to decide wether to `eager_load` or `preload`.
|
| | | |
|
|/ /
| |
| |
| | |
after loading it from YAML - fixes #13861
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`find_in_batches` now returns an `Enumerator`
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/relation/batches.rb
|
| | |
| | |
| | |
| | |
| | |
| | | |
so that it
can be chained with other `Enumerable` methods.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Dangerous name conflicts includes instance or class method conflicts
with methods defined within `ActiveRecord::Base` but not its ancestors,
as well as conflicts with methods generated by other enums on the same
class.
Fixes #13389.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Similar to dangerous attribute methods, a scope name conflict is
dangerous if it conflicts with an existing class method defined within
`ActiveRecord::Base` but not its ancestors.
See also #13389.
*Godfrey Chan*, *Philippe Creux*
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Before:
>> ActiveRecord::Base.respond_to?(:find_by_something)
NoMethodError: undefined method `abstract_class?' for Object:Class
After:
>> ActiveRecord::Base.respond_to?(:find_by_something)
=> false
|
| | |
| | |
| | |
| | |
| | |
| | | |
- fixes #13788
As per the documentation at lock!, if the :lock option is a string it should use the given SQL to generate the lock statement.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With this we can write `Model#select(:aliased)`, `Model#order(:aliased)`,
`Model#reoder(aliased: :desc)`, etc.
Supplementary work to 54122067acaad39b277a5363c6d11d6804c7bf6b.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Add docs about behaviour of replacing a has_one associate object.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
previous one is deleted even if the new one
doesn't get persisted to database.
Fixes #13197 . [ci skip]
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Hopefully make it easier to debug errors. e.g
Before:
RuntimeError:
unscope(where: "deleted_at") failed: unscoping String is unimplemented.
After:
RuntimeError:
unscope(where: "deleted_at") failed: unscoping String "'t'='t'" is unimplemented.
|
|\ \ \
| | | |
| | | | |
Fix `ActiveRecord::RecordNotFound` error message with custom primary key
|
| | | | |
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | | |
Better ActiveRecord hierarchy for Dirty and others
|
| | | |
| | | |
| | | | |
Move serialization dirty into serialization.rb
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Remove duplicate merge
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | | |
Need to define #reset on CollectionProxy.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit fixes two regressions introduced in cafe31a078 where
newly created finder methods #second, #third, #forth, and #fifth
caused a NoMethodError error on reload associations and where we
were pulling the wrong element out of cached associations.
Examples:
some_book.authors.reload.second
# Before
# => NoMethodError: undefined method 'first' for nil:NilClass
# After
# => #<Author id: 2, name: "Sally Second", ...>
some_book.first.authors.first
some_book.first.authors.second
# Before
# => #<Author id: 1, name: "Freddy First", ...>
# => #<Author id: 1, name: "Freddy First", ...>
# After
# => #<Author id: 1, name: "Freddy First", ...>
# => #<Author id: 2, name: "Sally Second", ...>
Fixes #13783.
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | | |
Implement the Dirty API with the Enum feature correctly.
Conflicts:
activerecord/CHANGELOG.md
|