Class: ManageableContent::Page

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/manageable_content/page.rb

Instance Method Summary collapse

Instance Method Details

#content(key) ⇒ Object

Retrieves a content with the given key.



18
19
20
# File 'app/models/manageable_content/page.rb', line 18

def content(key)
  page_content(key).try(:content)
end

#page_content(key) ⇒ Object

Retrieves a PageContent with the given key.



12
13
14
15
# File 'app/models/manageable_content/page.rb', line 12

def page_content(key)
  key = key.to_s
  page_contents.detect { |page_content| page_content.key == key }
end