2005-01-02 03:22:16 +08:00
|
|
|
first_client:
|
|
|
|
id: 2
|
|
|
|
type: Client
|
|
|
|
firm_id: 1
|
|
|
|
client_of: 2
|
|
|
|
name: Summit
|
2008-06-01 14:19:40 +08:00
|
|
|
firm_name: 37signals
|
2005-01-02 03:22:16 +08:00
|
|
|
|
|
|
|
first_firm:
|
|
|
|
id: 1
|
|
|
|
type: Firm
|
|
|
|
name: 37signals
|
2010-12-24 08:14:46 +08:00
|
|
|
firm_id: 1
|
2005-01-02 03:22:16 +08:00
|
|
|
|
|
|
|
second_client:
|
|
|
|
id: 3
|
|
|
|
type: Client
|
|
|
|
firm_id: 1
|
|
|
|
client_of: 1
|
|
|
|
name: Microsoft
|
2005-06-13 20:03:33 +08:00
|
|
|
|
|
|
|
another_firm:
|
|
|
|
id: 4
|
|
|
|
type: Firm
|
|
|
|
name: Flamboyant Software
|
|
|
|
|
|
|
|
another_client:
|
|
|
|
id: 5
|
|
|
|
type: Client
|
|
|
|
firm_id: 4
|
|
|
|
client_of: 4
|
|
|
|
name: Ex Nihilo
|
2005-10-15 08:46:55 +08:00
|
|
|
|
2009-07-01 06:55:09 +08:00
|
|
|
a_third_client:
|
|
|
|
id: 10
|
|
|
|
type: Client
|
|
|
|
firm_id: 4
|
|
|
|
client_of: 4
|
|
|
|
name: Ex Nihilo Part Deux
|
|
|
|
|
2005-10-15 08:46:55 +08:00
|
|
|
rails_core:
|
2010-08-14 13:13:00 +08:00
|
|
|
id: 6
|
2005-10-17 04:50:06 +08:00
|
|
|
name: RailsCore
|
2005-10-15 08:46:55 +08:00
|
|
|
type: DependentFirm
|
2010-08-14 13:13:00 +08:00
|
|
|
|
2005-10-15 08:46:55 +08:00
|
|
|
leetsoft:
|
2010-08-14 13:13:00 +08:00
|
|
|
id: 7
|
2005-10-17 04:50:06 +08:00
|
|
|
name: Leetsoft
|
2005-10-15 08:46:55 +08:00
|
|
|
client_of: 6
|
2010-08-14 13:13:00 +08:00
|
|
|
|
2005-10-15 08:46:55 +08:00
|
|
|
jadedpixel:
|
2010-08-14 13:13:00 +08:00
|
|
|
id: 8
|
2005-10-17 04:50:06 +08:00
|
|
|
name: Jadedpixel
|
2006-08-30 01:06:27 +08:00
|
|
|
client_of: 6
|
|
|
|
|
|
|
|
odegy:
|
|
|
|
id: 9
|
|
|
|
name: Odegy
|
|
|
|
type: ExclusivelyDependentFirm
|
Ensure AR #second, #third, etc. finders work through associations
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.
2014-01-22 06:34:39 +08:00
|
|
|
|
|
|
|
another_first_firm_client:
|
|
|
|
id: 11
|
|
|
|
type: Client
|
|
|
|
firm_id: 1
|
|
|
|
client_of: 1
|
|
|
|
name: Apex
|
|
|
|
firm_name: 37signals
|
2021-02-12 00:32:20 +08:00
|
|
|
|
|
|
|
recursive_association_fk:
|
|
|
|
id: 15
|
|
|
|
type: Firm
|
|
|
|
name: RVshare
|