1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

14 commits

Author SHA1 Message Date
Matthew Draper
8d04150709 Ensure Contract#metadata is reliably orderable
This gets an annoyingly verbose comment, because otherwise it could be
removed and continue passing almost all the time.
2022-02-26 03:39:02 +10:30
Ryuta Kamizono
cbb19eb833 Fix complicated has_many through with nested where condition
#40779 will be caused if (1) having nested where condition for through
association, and (2) through scope has references values, and (3) the
model has no association which is the same name with table name.

In that case, the join root will be found by the table name but the join
root isn't related with association reflection.

This changes to return the table klass from join dependency tree, it
works regardless of whether the join root or join association children.

Fixes #40779.
2021-01-05 11:40:04 +09:00
Ryuta Kamizono
0ee96d13de Fix pluck and select with custom attributes
Currently custom attributes are always qualified by the table name in
the generated SQL wrongly even if the table doesn't have the named
column, it would cause an invalid SQL error.

Custom attributes should only be qualified if the table has the same
named column.
2019-02-13 02:47:46 +09:00
Guo Xiang Tan
90240f664c Fix regression setting children record in parent before_save callback. 2018-09-03 13:34:24 +08:00
Ryuta Kamizono
bde0041f0a Add test case for collection_singular_ids with symbol primary keys
This is a regression test for #27864.
2018-01-01 05:26:35 +09:00
Kir Shatrov
831be98f9a Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Xavier Noria
d22e522179 modernizes hash syntax in activerecord 2016-08-06 19:37:57 +02:00
Xavier Noria
9617db2078 applies new string literal convention in activerecord/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:26:53 +02:00
Aaron Patterson
3e0a60e4e2 adding a test to demonstrate how to use STI subclasses on the far right
side of a hm:t association along with preloading.
2013-09-27 16:56:49 -07:00
Farley Knight
aa316e27b7 Tests for issue #1360 2011-05-31 19:47:34 +01:00
Jon Leighton
eba7664086 Respect the default_scope on a join model when reading a through association 2010-12-16 01:49:30 +05:30
railsbob
e06a0b03c8 has_many :through create should not raise validation errors
[#2934 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 18:44:45 -07:00