| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| | |
Preserve readonly flag only for readonly association
|
| |
| |
| |
| | |
Fixes #24093
|
|\ \
| | |
| | | |
Fix inconsistent the signature of finder methods for collection association
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`#second`, `#third`, etc finder methods was added in 03855e790de2224519f55382e3c32118be31eeff.
But the signature of these methods is inconsistent with the original
finder methods. And also the signature of `#first` and `#last` methods
is different from the original. This commit fixes the inconsistency.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
kamipo/finder_bang_method_should_call_non_bang_method
Finder bang method should call non bang method
|
| |/ /
| | |
| | |
| | | |
Otherwise CollectionProxy's bang methdos cannot respect dirty target.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The current behaviour of checking if there is a LEFT OUTER JOIN arel
node to detect if we are doing eager_loading is wrong. This problem
wasn't frequent before as only some pretty specific cases would add
a LEFT OUTER JOIN arel node. However, the recent new feature
left_outer_joins also add this node and made this problem happen
frequently.
Since in the perform_calculation function, we don't have access to
eager_loading information, I had to extract the logic for the distinct
out to the calculate method.
As I was in the file for left_outer_join tests, I fixed a few that had
bugs and I replaced some that were really weak with something that
will catch more issues.
In relation tests, the first test I changed would have failed if it
had validated the hash returned by count instead of just checking how
many pairs were in it. This is because this merge of join currently
transforms the join node into an outer join node, which then made
count do a distinct. So before this change, the return was
{1=>1, 4=>1, 5=>1}.
|
|\ \
| | |
| | | |
When calling association.find RecordNotFound is now raised with the s…
|
| | |
| | |
| | |
| | | |
argument as when we do it in Record.find (primary_key, id and model).
|
|\ \ \
| | | |
| | | | |
`CollectionProxy#take` should respect dirty target
|
| |/ /
| | |
| | |
| | |
| | | |
`#first`, `#second`, ..., `#last` methods respects dirty target. But
`#take` doesn't respect it. This commit fixes the inconsistent behavior.
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
| |
| |
| |
| | |
Hash syntax auto-correcting breaks alignments. 411ccbdab2608c62aabdb320d52cb02d446bb39c
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|\
| |
| |
| |
| | |
kamipo/association_name_is_the_same_as_join_table_name
Correctly return `associated_table` when `associated_with?` is true
|
| |
| |
| |
| |
| |
| |
| | |
`AssociationQueryHandler` requires `association` initialized
`TableMetadata` even if `table_name == arel_table.name`.
Fixes #25689.
|
| |
| |
| |
| | |
These test cases tests exactly mutating loaded target.
|
| |
| |
| |
| | |
This is not a test case.
|
| | |
|
| |
| |
| |
| |
| | |
Where appropriatei, prefer the more concise Regexp#match?,
String#include?, String#start_with?, or String#end_with?
|
| |
| |
| |
| |
| |
| | |
association scope
Fixes #25732.
|
|\ \
| | |
| | |
| | |
| | | |
kamipo/move_warning_about_composite_primary_key_to_attribute_methods_primary_key
Move the warning about composite primary key to `AttributeMethods::PrimaryKey`
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Actually schema dumper/creation supports composite primary key (#21614).
Therefore it should not show the warning about composite primary key in
connection adapter.
This change moves the warning to `AttributeMethods::PrimaryKey` and
suppress the warning for habtm join table.
Fixes #25388.
|
|/
|
|
| |
`HasManyAssociationsTest#test_do_not_call_callbacks_for_delete_all`
|
|
|
|
|
|
|
|
|
|
| |
`construct_relation_for_association_calculations` pass a string value to
`construct_join_dependency` when setting a string value in `from`.
It should not pass a string value, but always `joins_values`.
Related #14834, #19452.
Fixes #24193.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently `exists?` does some hackery where it assumes that we can join
onto anything that we passed to `eager_load` or `includes`, which
doesn't work if we are joining onto a polymorphic association.
Actually figuring out if we want to include something would require
knowledge deep within the join dependency module, which is hard to pull
up. The simplest solution is just to pass a flag down that says we're
not actually going to try to eager load any of the data. It's not the
solution I'd like, but that code really needs to be untangled before we
can do much with it.
This is another attempt at 6d5b1fd which should address the concerns
that led to reverting it in 4ecabed.
|
|
|
|
| |
Fixes #25128
|
|
|
|
|
|
|
|
| |
Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005
* Forward compat with new unified Integer class in Ruby 2.4+.
* Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3.
* Drops needless Fixnum distinction in docs, preferring Integer.
|
|
|
|
|
|
|
| |
The error message that we give today makes this error difficult to debug
if you receive it. I have no clue why we're printing the object ID of
the class (the commit doesn't give context), but I've left it as it was
deliberate.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix undefined method `owners' for NullPreloader:Class
Fixing undefined method `owners' for
ActiveRecord::Associations::Preloader::NullPreloader:Class
* Use Ruby 1.9 hash format
Use Ruby 1.9 hash format
#24192
[Rafael Mendonça França + Ladislav Smola]
|
|\
| |
| |
| |
| | |
RochesterinNYC/better-error-message-for-includes-relations-missing
Improve error message for missing relations for includes and eager_load
|
| |
| |
| |
| | |
relations
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Closes #23934.
This is a forward port of ac832a43b4d026dbad28fed196d2de69ec9928ac
Previously the scope of all associations with extensions were wrapped in
an instance dependent proc. This made it impossible to preload such
associations.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the `source_type` option is passed to a has_many through, the
resulting `Reflection` will be an instance of `PolymorphicReflection`
and not `ThroughReflection`, meaning that it will ignore the scopes that
it needs to apply from the through reflections. This adds an additional
delegation call to remedy this. I've been finding the reflection code
completely impenetrable lately, it could use some major love.
Fixes #22726
|
|\ \
| | |
| | |
| | |
| | | |
Honour joining model order in `has_many :through` associations when
eager loading
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
association when eager loading.
Previously, eager loading a `has_many :through` association with no
defined order would return the records in the natural order of the
database. Now, these records will be returned in the order that the
joining record is returned, in case there is a defined order there.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
habtm join tables commonly have two id columns and it's OK to make those
two id columns a primary key. This commit eliminates the warnings for
join tables that have this setup.
ManageIQ/manageiq#6713
|
| | | |
|
| | | |
|