Class: BlueberryCMS::PageBlock
- Inherits:
-
Object
- Object
- BlueberryCMS::PageBlock
show all
- Includes:
- Mongoid::Attributes::Dynamic, Mongoid::Document
- Defined in:
- app/models/blueberry_cms/page_block.rb
Constant Summary
collapse
- MARGINS =
%w[0 xs sm md lg xl].freeze
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.types ⇒ Object
33
34
35
36
37
38
|
# File 'app/models/blueberry_cms/page_block.rb', line 33
def self.types
@types ||= [
BlueberryCMS::PageBlocks::Gallery,
BlueberryCMS::PageBlocks::RichText
] + BlueberryCMS.custom_blocks
end
|
Instance Method Details
#to_partial_path ⇒ Object
40
41
42
|
# File 'app/models/blueberry_cms/page_block.rb', line 40
def to_partial_path
"page_blocks/#{self.class.name.demodulize.downcase}"
end
|
#used_for_sharing? ⇒ Boolean
22
23
24
|
# File 'app/models/blueberry_cms/page_block.rb', line 22
def used_for_sharing?
BlueberryCMS::Page.where('blocks.block_id' => _id).any?
end
|