app/models/tramway/landing/block.rb in tramway-landing-3.0.1.2 vs app/models/tramway/landing/block.rb in tramway-landing-3.0.2

- old
+ new

@@ -24,23 +24,23 @@ store_accessor :values, :form_url store_accessor :button, :button_link store_accessor :button, :button_title - scope :on_main_page, -> do - active.joins(:page).where(view_state: :published).where('tramway_page_pages.page_type = ?', :main).order :position - end + scope :on_main_page, lambda { + active.joins(:page).where(view_state: :published).where('tramway_page_pages.page_type = ?', :main).order :position + } scope :with_navbar_link, -> { where navbar_link: :exist } scope :header, -> { on_main_page.where(block_type: :header).first } scope :footer, -> { on_main_page.where(block_type: :footer).first } scope :published, -> { where(view_state: :published) } def link_object link_object_type.constantize.find link_object_id end def header? - block_type.in? [ 'header', 'header_with_form'] + block_type.in? %w[header header_with_form] end def footer? block_type.footer? end