Sha256: 96d5550510919790d1a6d01cfe465a6671a8b7b2d4a26dfaa15b533c7970a779
Contents?: true
Size: 661 Bytes
Versions: 23
Compression:
Stored size: 661 Bytes
Contents
module Para module Admin::ComponentsHelper # Return the sections / components structure, with components properly # decorated # def admin_component_sections @admin_component_sections ||= begin Para::ComponentSection.ordered.includes(:components).tap do |sections| sections.flat_map(&:components).each(&method(:decorate)) end end end def ordered_components admin_component_sections.each_with_object([]) do |section, components| section.components.each do |component| components << component if can?(:read, component) end end.sort_by(&:name) end end end
Version data entries
23 entries across 23 versions & 1 rubygems