Class: Cdx::Site

Inherits:
ApplicationRecord show all
Includes:
Resourceable
Defined in:
app/models/cdx/site.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AttachmentMacros

#has_many_attached, #has_one_attached

Class Method Details

.current(domain = nil) ⇒ Object



23
24
25
26
# File 'app/models/cdx/site.rb', line 23

def self.current(domain = nil)
  current_site = domain ? Site.by_domain(domain).first : nil
  current_site || Site.default
end

.defaultObject



28
29
30
31
32
# File 'app/models/cdx/site.rb', line 28

def self.default
  Rails.cache.fetch('default_site') do
    where(default: true).first_or_initialize
  end
end

Instance Method Details

#content_header_titleObject

Methods



19
20
21
# File 'app/models/cdx/site.rb', line 19

def content_header_title
  name
end