2005-01-01 14:22:16 -05:00
|
|
|
first_client:
|
|
|
|
id: 2
|
|
|
|
type: Client
|
|
|
|
firm_id: 1
|
|
|
|
client_of: 2
|
|
|
|
name: Summit
|
2008-06-01 02:19:40 -04:00
|
|
|
firm_name: 37signals
|
2005-01-01 14:22:16 -05:00
|
|
|
|
|
|
|
first_firm:
|
|
|
|
id: 1
|
|
|
|
type: Firm
|
|
|
|
name: 37signals
|
2010-12-23 19:14:46 -05:00
|
|
|
firm_id: 1
|
2005-01-01 14:22:16 -05:00
|
|
|
|
|
|
|
second_client:
|
|
|
|
id: 3
|
|
|
|
type: Client
|
|
|
|
firm_id: 1
|
|
|
|
client_of: 1
|
|
|
|
name: Microsoft
|
2005-06-13 08:03:33 -04: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-14 20:46:55 -04:00
|
|
|
|
2009-06-30 18:55:09 -04:00
|
|
|
a_third_client:
|
|
|
|
id: 10
|
|
|
|
type: Client
|
|
|
|
firm_id: 4
|
|
|
|
client_of: 4
|
|
|
|
name: Ex Nihilo Part Deux
|
|
|
|
|
2005-10-14 20:46:55 -04:00
|
|
|
rails_core:
|
2010-08-14 01:13:00 -04:00
|
|
|
id: 6
|
2005-10-16 16:50:06 -04:00
|
|
|
name: RailsCore
|
2005-10-14 20:46:55 -04:00
|
|
|
type: DependentFirm
|
2010-08-14 01:13:00 -04:00
|
|
|
|
2005-10-14 20:46:55 -04:00
|
|
|
leetsoft:
|
2010-08-14 01:13:00 -04:00
|
|
|
id: 7
|
2005-10-16 16:50:06 -04:00
|
|
|
name: Leetsoft
|
2005-10-14 20:46:55 -04:00
|
|
|
client_of: 6
|
2010-08-14 01:13:00 -04:00
|
|
|
|
2005-10-14 20:46:55 -04:00
|
|
|
jadedpixel:
|
2010-08-14 01:13:00 -04:00
|
|
|
id: 8
|
2005-10-16 16:50:06 -04:00
|
|
|
name: Jadedpixel
|
2006-08-29 13:06:27 -04: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-21 17:34:39 -05:00
|
|
|
|
|
|
|
another_first_firm_client:
|
|
|
|
id: 11
|
|
|
|
type: Client
|
|
|
|
firm_id: 1
|
|
|
|
client_of: 1
|
|
|
|
name: Apex
|
|
|
|
firm_name: 37signals
|