Sha256: 86d7ba63373752056a73659410bfe96e01fd2ea1cd20d48eaff59a8e7e0242f2

Contents?: true

Size: 908 Bytes

Versions: 4

Compression:

Stored size: 908 Bytes

Contents

Iqvoc.default_rdf_namespace_helper_methods.each do |meth|
  document.namespaces(self.send(meth))
end

offset = 0
while true
  # The following code doesn't have much to do with MVC programming. Due to the
  # fact you can't render a view from a controller multiple times we had to
  # move the logic to the view.
  
  concepts = Iqvoc::Concept.base_class.published.order("id").limit(100).offset(offset).all
  break if concepts.size == 0

  # When in single query mode, AR handles ALL includes to be loaded by that
  # one query. We don't want that! So let's do it manually :-)
  Concept::Base.send(:preload_associations, concepts, Iqvoc::Concept.base_class.default_includes + [:matches, :collection_members, {:relations => :target, :labelings => :target, :notes => :annotations}])

  concepts.each do |concept|
    render_concept(document, concept)
  end
  
  offset+= concepts.size # Size is important!

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iqvoc-3.2.6 app/views/concepts/index.iqrdf
iqvoc-3.2.5 app/views/concepts/index.iqrdf
iqvoc-3.2.4 app/views/concepts/index.iqrdf
iqvoc-3.2.3 app/views/concepts/index.iqrdf