Sha256: f2f53a536f60d621a6f98b46ad5e84007eb9946f7190096f37a3545fe7dbe105

Contents?: true

Size: 573 Bytes

Versions: 7

Compression:

Stored size: 573 Bytes

Contents

module Kuztuscms
  class Layout < ActiveRecord::Base
    validates :body, :path, :presence => true
    validates :path, :format => { :with => /\A[a-z0-9_]+\z/, :message => "Only lowercase letters, numbers and dashes allowed"}

    validates :format,  :inclusion => Mime::SET.symbols.map(&:to_s)
    validates :locale,  :inclusion => I18n.available_locales.map(&:to_s)
    validates :handler, :inclusion => ActionView::Template::Handlers.extensions.map(&:to_s)

    class_attribute :prefix

    after_save do
      Kuztuscms::Resolver.instance.clear_cache
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kuztuscms-0.0.10 app/models/kuztuscms/layout.rb
kuztuscms-0.0.9 app/models/kuztuscms/layout.rb
kuztuscms-0.0.8 app/models/kuztuscms/layout.rb
kuztuscms-0.0.7 app/models/kuztuscms/layout.rb
kuztuscms-0.0.6 app/models/kuztuscms/layout.rb
kuztuscms-0.0.5 app/models/kuztuscms/layout.rb
kuztuscms-0.0.4 app/models/kuztuscms/layout.rb