Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Infinite recursion when preloading associations and using custom class methods #5667
I have a problem with preloading associations when combined with a call to a custom class method. The issue is reproducible with this simple setup:
class User < ActiveRecord::Base belongs_to :group def self.fancy(id) find(id) end end class Group < ActiveRecord::Base has_many :users end
Everything works fine when calling something like this:
This issue exists in both Rails 3.2.2 and current master.
As I'd get a real performance benefit for my application, I'm willing to help as much as possible in fixing this. Looking through the source I could not find a cause, yet. Any pointers what might be the reason are appreciated :)
I was able to track down the issue to
referenced this issue
Apr 3, 2012
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
This fixed cause some subtle regression. Haven't been able to get an isolated repro yet.