Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Finally, we have this innocuous looking patch. Without it, queries like this: current_account.tickets.recent.count | ||
# would instantiate AR objects all (!!) tickets in the account, not merely return a count of the recent ones. | ||
# See https://rails.lighthouseapp.com/projects/8994/tickets/5410-multiple-database-queries-when-chaining-named-scopes-with-rails-238-and-ruby-192 | ||
# (The patch in that lighthouse bug was not, in fact, merged in). | ||
module ActiveRecord | ||
module Associations | ||
class AssociationProxy | ||
def respond_to_missing?(meth, incl_priv) | ||
false | ||
end | ||
end | ||
end | ||
end |