Sha256: 8215e1fa926fb8577f2c95b81c5e87fb26d7e2c3cfefb8c6bda4024c965ca900

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

module Cardboard
  class Template < ActiveRecord::Base

    serialize :fields, Hash

    has_many :pages

    validates :identifier, uniqueness: {:case_sensitive => false}, :format => { :with => /\A[a-z\_0-9]+\z/,
                           :message => "Only downcase letters, numbers and underscores are allowed" }
    
    after_save :reload_routes
    def reload_routes
      DynamicRouter.reload
    end

    def name
      self[:name] || self.identifier
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cardboard_cms-0.3.1 app/models/cardboard/template.rb