Sha256: 8be9b5b218bcdba94ed112d825a6dbd03381fcc0d78202f55028e01555c5cf5d
Contents?: true
Size: 937 Bytes
Versions: 8
Compression:
Stored size: 937 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, true) end offset+= concepts.size # Size is important! end
Version data entries
8 entries across 8 versions & 1 rubygems