class Site
Constants
- ARTICLE_ROLES
- EVENT_ROLES
- FEATURE_ROLES
- FULL_ROLES
- PAGE_EDITION_ROLES
- SITE_ROLES
Public Instance Methods
categories(type)
click to toggle source
# File lib/buweb/site.rb, line 71 def categories(type) site_categories.where type: type end
enabled_mediums()
click to toggle source
# File lib/buweb/site.rb, line 84 def enabled_mediums mediums = [] mediums << "Article" if has_articles mediums << "Event" if has_events return mediums end
enabled_roles()
click to toggle source
# File lib/buweb/site.rb, line 75 def enabled_roles roles = SITE_ROLES roles = roles.merge(ARTICLE_ROLES) if has_articles roles = roles.merge(EVENT_ROLES) if has_events roles = roles.merge(FEATURE_ROLES) if has_features roles = roles.merge(PAGE_EDITION_ROLES) if has_page_editions return roles end
Protected Instance Methods
set_slug()
click to toggle source
# File lib/buweb/site.rb, line 92 def set_slug self.slug = title.parameterize if title? end