Project

General

Profile

Actions

Bug #12011

closed

Replace .includes(table).where(table) by .eager_load

Added by Daniel Lobato Garcia about 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Rails
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

On Rails 3, .includes(:users).where("users.name = 'daniel'") works because Rails would be smart enough to figure out the where query uses the includes table.
In this case it'd internally resolve it to eager_load to use the table users in the query. However on Rails 4 they decided they didn't want to maintain a parser for
SQL, so you have to append .references(:table) after all .includes(:table).where("SQL that uses table"). This is not retrocompatible, but we can directly use
eager_load on Rails 3 and 4 to avoid using .references.


Related issues 1 (0 open1 closed)

Related to Foreman - Tracker #3157: Rails 4.1 upgrade tasksClosed09/27/2013

Actions
Actions #1

Updated by Daniel Lobato Garcia about 9 years ago

  • Related to Bug #3517: Help text for 'domain create' does not line up correctly added
Actions #2

Updated by Daniel Lobato Garcia about 9 years ago

Actions #3

Updated by Daniel Lobato Garcia about 9 years ago

  • Related to deleted (Bug #3517: Help text for 'domain create' does not line up correctly)
Actions #4

Updated by The Foreman Bot about 9 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2768 added
  • Pull request deleted ()
Actions #5

Updated by Dominic Cleal about 9 years ago

  • Translation missing: en.field_release set to 71
Actions #6

Updated by Daniel Lobato Garcia about 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF