Class: Skyline::Sections::ContentCollectionSection

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Skyline::SectionItem, Taggable
Defined in:
app/models/skyline/sections/content_collection_section.rb

Instance Method Summary collapse

Methods included from Taggable

#available_tags, #clone_with_associated_tags, #raw_tags, #raw_tags=

Methods included from Skyline::SectionItem

#to_text

Instance Method Details

#cloneObject



21
22
23
24
25
# File 'app/models/skyline/sections/content_collection_section.rb', line 21

def clone
  returning super do |clone|
    clone.associated_tags = self.associated_tags.collect{|associated_tag| associated_tag.clone}
  end
end

#content_classObject



9
10
11
# File 'app/models/skyline/sections/content_collection_section.rb', line 9

def content_class
  @content_class ||= self.content_type.constantize    
end

#content_nameObject



13
14
15
16
17
18
19
# File 'app/models/skyline/sections/content_collection_section.rb', line 13

def content_name
  if self.content_class.name.demodulize == "Data" 
    self.content_class.parent.name.underscore 
  else
    self.content_class.name.underscore 
  end    
end