Sha256: f40c6eb1552b428cc3274482aec293cd32da588682bf65c682793841c1802806

Contents?: true

Size: 423 Bytes

Versions: 9

Compression:

Stored size: 423 Bytes

Contents

class DomainTheme < ActiveRecord::Base
  
  validates_presence_of :name, :uri
  
  class << self
    def use_domain_themes?
      Disguise::USE_DOMAIN_FOR_THEMES
    end
  
    def get_theme(request)
      domain_theme = get_domain_theme(request)
      domain_theme.blank? ? nil : Theme.new(:name => domain_theme.name)
    end
    
    def get_domain_theme(request)
      self.find_by_uri(request.host)
    end
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
disguise-0.3.11 app/models/domain_theme.rb
disguise-0.3.10 app/models/domain_theme.rb
disguise-0.3.8 app/models/domain_theme.rb
disguise-0.3.7 app/models/domain_theme.rb
disguise-0.3.6 app/models/domain_theme.rb
disguise-0.3.2 app/models/domain_theme.rb
disguise-0.3.3 app/models/domain_theme.rb
disguise-0.3.4 app/models/domain_theme.rb
disguise-0.3.5 app/models/domain_theme.rb