app/presenters/refinery/pages/content_presenter.rb in refinerycms-pages-2.1.5 vs app/presenters/refinery/pages/content_presenter.rb in refinerycms-pages-3.0.0

- old
+ new

@@ -10,20 +10,21 @@ def initialize(initial_sections = []) @sections = initial_sections end def blank_section_css_classes(can_use_fallback = true) - @sections.reject {|section| section.has_content?(can_use_fallback)}.map(&:not_present_css_class) + @sections.reject { |section| section.has_content?(can_use_fallback)} + .map(&:not_present_css_class) end def hide_sections(*ids_to_hide) ids_to_hide.flatten! - @sections.select {|section| ids_to_hide.include?(section.id)}.each(&:hide) if ids_to_hide.any? + @sections.select { |section| ids_to_hide.include?(section.id)}.each(&:hide) if ids_to_hide.any? end def hidden_sections - @sections.select {|section| section.hidden? } + @sections.select(&:hidden?) end def fetch_template_overrides @sections.each do |section| section.override_html = yield section.id if section.id.present? @@ -45,18 +46,19 @@ end private def sections_html(can_use_fallback) - @sections.map { |section| section.wrapped_html(can_use_fallback) }.compact.join("\n").html_safe + @sections.map { |section| section.wrapped_html(can_use_fallback) } + .compact.join("\n").html_safe end def add_section_if_missing(options) add_section SectionPresenter.new(options) unless has_section?(options[:id]) end def has_section?(id) - @sections.detect {|section| section.id == id} + @sections.detect { |section| section.id == id} end end end end