mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fb160f6e7d
If there is a method defined such as `find_and_do_stuff(id)`, which then gets called on an association, we will perform statement caching and the parent ID will not change on subsequent calls. Fixes #18117
11 lines
160 B
Ruby
11 lines
160 B
Ruby
class Tyre < ActiveRecord::Base
|
|
belongs_to :car
|
|
|
|
def self.custom_find(id)
|
|
find(id)
|
|
end
|
|
|
|
def self.custom_find_by(*args)
|
|
find_by(*args)
|
|
end
|
|
end
|