Class: Locomotive::Site

Inherits:
Object
  • Object
show all
Extended by:
Extensions::Site::FirstInstallation, Extensions::Site::SubdomainDomains
Includes:
Extensions::Shared::Seo, Extensions::Site::Locales, Mongoid::Document
Defined in:
app/models/locomotive/site.rb

Instance Method Summary collapse

Methods included from Extensions::Site::SubdomainDomains

enable_subdomain_n_domains_if_multi_sites

Methods included from Extensions::Site::FirstInstallation

create_first_one

Methods included from Extensions::Site::Locales

#default_locale, #default_locale_was, #locale_fallbacks, #locales=, #localized?, #localized_page_fullpath

Instance Method Details

#accountsObject



46
47
48
# File 'app/models/locomotive/site.rb', line 46

def accounts
  Account.criteria.in(:_id => self.memberships.map(&:account_id))
end

#admin_membershipsObject



50
51
52
# File 'app/models/locomotive/site.rb', line 50

def admin_memberships
  self.memberships.find_all { |m| m.admin? }
end

#all_pages_in_onceObject

methods ##



38
39
40
# File 'app/models/locomotive/site.rb', line 38

def all_pages_in_once
  Page.quick_tree(self)
end

#fetch_page(path, logged_in) ⇒ Object



42
43
44
# File 'app/models/locomotive/site.rb', line 42

def fetch_page(path, logged_in)
  Locomotive::Page.fetch_page_from_path self, path, logged_in
end

#nameObject

validations ##



13
# File 'app/models/locomotive/site.rb', line 13

field :name

#pagesObject

associations ##



17
# File 'app/models/locomotive/site.rb', line 17

references_many :pages,           :class_name => 'Locomotive::Page',          :validate => false