Sha256: a7b1831dddb78e1900fe58e80c956cbbc59c86477b04771774ef86823b92b8e8

Contents?: true

Size: 515 Bytes

Versions: 14

Compression:

Stored size: 515 Bytes

Contents

class Ecm::Cms::Template < ActiveRecord::Base
  # add shared behaviour for database backed templates
  include Ecm::Cms::DatabaseTemplate

  # associations
  belongs_to :ecm_cms_folder,
             class_name: 'Ecm::Cms::Folder',
             foreign_key: 'ecm_cms_folder_id'

  # callbacks
  before_validation :ensure_basename_starts_without_underscore, if: proc { |t| t.basename.present? }

  private

  def ensure_basename_starts_without_underscore
    basename.slice!(0) if basename.start_with?('_')
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ecm_cms2-4.0.1 app/models/ecm/cms/template.rb
ecm_cms2-4.0.0 app/models/ecm/cms/template.rb
ecm_cms2-3.0.3 app/models/ecm/cms/template.rb
ecm_cms2-3.0.2 app/models/ecm/cms/template.rb
ecm_cms2-3.0.1 app/models/ecm/cms/template.rb
ecm_cms2-3.0.0 app/models/ecm/cms/template.rb
ecm_cms2-2.1.4 app/models/ecm/cms/template.rb
ecm_cms2-2.1.3 app/models/ecm/cms/template.rb
ecm_cms2-2.1.2 app/models/ecm/cms/template.rb
ecm_cms2-2.1.1 app/models/ecm/cms/template.rb
ecm_cms2-2.1.0 app/models/ecm/cms/template.rb
ecm_cms2-2.0.4 app/models/ecm/cms/template.rb
ecm_cms2-2.0.3 app/models/ecm/cms/template.rb
ecm_cms2-2.0.2 app/models/ecm/cms/template.rb