Sha256: cae75aa7594d470e49851205cd6ebf38b304906eab9cbbdd97404a78c4ef738a
Contents?: true
Size: 1.06 KB
Versions: 1
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true module Archangel ## # Site model # class Site < ApplicationRecord acts_as_paranoid mount_uploader :logo, Archangel::LogoUploader validates :locale, presence: true, inclusion: { in: Archangel::LANGUAGES } validates :logo, file_size: { less_than_or_equal_to: Archangel.config.image_maximum_file_size } validates :name, presence: true validates :theme, inclusion: { in: Archangel.themes }, allow_blank: true has_many :assets has_many :pages has_many :templates has_many :users has_many :widgets has_many :collections has_many :entries, through: :collections has_many :fields, through: :collections ## # Current site # # @return [Object] first availabe site as current site # def self.current first_or_create do |site| site.name = "Archangel" end end ## # Liquid object for Site # # @return [Object] the Liquid object # def to_liquid Archangel::Liquid::Drops::SiteDrop.new(self) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
archangel-0.0.8 | app/models/archangel/site.rb |