Eager loading doesn't work when querying scoped associations

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 2.4.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Given the following:

      class User
        has_many :accounts
      end
      
      class Account
        field :name
        field :large_array, type: Array
      
        scope :basic, only(:name)
      
        belongs_to :user
      end
      

      u = User.includes(:accounts).first

      The following won't access the Identity Map:
      u.accounts.basic.first

      I was expecting that to work. Perhaps I'm doing something wrong?

              Assignee:
              Durran Jordan
              Reporter:
              Fredrik Björk
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: