Class: Workarea::Storefront::ContentBlocks::BlogEntryContentBlockViewModel

Inherits:
ContentBlockViewModel
  • Object
show all
Defined in:
app/view_models/workarea/storefront/content_blocks/blog_entry_content_block_view_model.rb

Instance Method Summary collapse

Instance Method Details

#localsObject



5
6
7
8
9
# File 'app/view_models/workarea/storefront/content_blocks/blog_entry_content_block_view_model.rb', line 5

def locals
  return super if manual_entries_missing?

  super.merge(entries: entries)
end

#multiple_entries?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
# File 'app/view_models/workarea/storefront/content_blocks/blog_entry_content_block_view_model.rb', line 11

def multiple_entries?
  if use_manual_entries?
    model.data[:blog_entry].count > 1
  else
    model.data[:number_of_entries] > 1
  end
end