title: How do I prevent an ActiveResource model from making a request?
body: <p>I have some ActiveResource models like so:</p>
  <pre><code>class Meeting
    has_many :sections
  end
  
  class Section
    has_many :items
  end
  
  class Items
    has_many :items
  end
  </code></pre>
  <p>When I do a find on a Meeting, I get a json response like:</p>
  <pre><code>   {
        id: 1, ...
        sections: [
          {
            id: 1, ...
            items: [
              {id: 16, ...
               items: [
                 {id: 534, ...
                  items: [
                    {id: 8976, ...},
                    {id: 8977, ...}
                  ]}
               ]}
            ]
          }
      }
  
  </code></pre>
  <p>And run the following (heavily edited) routine:</p>
  <pre><code>    @meeting = Meeting.find(@meeting_guid)
      import_sections
  
  
      private
  
      def import_sections
        @meeting.sections.each do |section|
          new_section = Item.find_or_initialize_by(foreign_guid: section.guid)
          new_section.update!(layout: :section)
          import_items(section, new_section)
        end
      end
  
      def import_items(item, parent)
        item.items.each do |item|
          position = mema_item.orderpreference.to_i + 1
          sub_item = Item.find_or_initialize_by(foreign_guid: item.guid)
          sub_item.update!(layout: :item, title: item.name, parent: parent)
          import_items(item, sub_item)
        end
      end
  </code></pre>
  <p>When it hits Items 8976 and 8977, it makes requests to <code>/items?item_id=8976</code> and <code>/items?item_id=8977</code>. Is there a way to prevent it from making these requests when it hits the end of the last child? I don't think I'll ever call Items directly, so can I disable requests on the Item model or something?</p>