Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1677

Eager loading not working with default_scope

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.4.4
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      Looks like the default_scope in this example is a no-op:

      class Post
      	include Mongoid::Document
      
      	default_scope includes(:tags)
      
      	field :title, type: String
      
      	has_many :tags
      
      	validates_presence_of :tags
      end
      
      class Tag
      	include Mongoid::Document
      
      	field :title, type: String
      
      	belongs_to :post
      end
      

            Assignee:
            durran Durran Jordan
            Reporter:
            behrangsa behrangsa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: