Sha256: 9eba01f07d4a999e87e373cd8a1cda04d16833712011b7c347f923573584e1ba

Contents?: true

Size: 931 Bytes

Versions: 15

Compression:

Stored size: 931 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 :-)
  ActiveRecord::Associations::Preloader.new(concepts,
    Iqvoc::Concept.base_class.default_includes + [
      :matches,
      :collection_members,
      {:relations => :target, :labelings => :target, :notes => :annotations}]).run

  concepts.each do |concept|
    render_concept(document, concept)
  end

  offset+= concepts.size # Size is important!

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
iqvoc-4.1.0 app/views/concepts/index.iqrdf
iqvoc-4.0.9 app/views/concepts/index.iqrdf
iqvoc-4.0.8 app/views/concepts/index.iqrdf
iqvoc-4.0.7 app/views/concepts/index.iqrdf
iqvoc-4.0.6 app/views/concepts/index.iqrdf
iqvoc-4.0.5 app/views/concepts/index.iqrdf
iqvoc-4.0.4 app/views/concepts/index.iqrdf
iqvoc-4.0.3 app/views/concepts/index.iqrdf
iqvoc-4.0.2 app/views/concepts/index.iqrdf
iqvoc-4.0.1 app/views/concepts/index.iqrdf
iqvoc-4.0.0 app/views/concepts/index.iqrdf
iqvoc-3.5.7 app/views/concepts/index.iqrdf
iqvoc-3.5.6 app/views/concepts/index.iqrdf
iqvoc-3.5.5 app/views/concepts/index.iqrdf
iqvoc-3.5.4 app/views/concepts/index.iqrdf