Sha256: 5ca0ffef8ee0778e2b9a62aa14248a5f0ebf02315ad73137ce71678a773d94cd

Contents?: true

Size: 448 Bytes

Versions: 2

Compression:

Stored size: 448 Bytes

Contents

class PagePart < ActiveRecord::Base
  has_paper_trail

  # Default Order
  default_scope { order('name') }

  # Associations
  belongs_to :page

  # Validations
  validates_presence_of :name
  validates_length_of :name, maximum: 100
  validates_length_of :filter_id, maximum: 25, allow_nil: true

  object_id_attr :filter, TextFilter

  def after_initialize
    self.filter_id ||= TrustyCms::Config['defaults.page.filter'] if new_record?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trusty-cms-7.0.8 app/models/page_part.rb
trusty-cms-7.0.7 app/models/page_part.rb