Sha256: 4e64f2bd5191c235ec331f0e84639734e733a8bd498b18e243f5338efb4914aa

Contents?: true

Size: 484 Bytes

Versions: 33

Compression:

Stored size: 484 Bytes

Contents

class PagePart < ActiveRecord::Base
  attr_accessible :name, :filter_id, :content

  # 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

33 entries across 33 versions & 1 rubygems

Version Path
trusty-cms-1.2.29 app/models/page_part.rb
trusty-cms-1.2.28 app/models/page_part.rb
trusty-cms-1.1.28 app/models/page_part.rb
trusty-cms-1.1.27 app/models/page_part.rb
trusty-cms-1.1.26 app/models/page_part.rb
trusty-cms-1.1.25 app/models/page_part.rb
trusty-cms-1.1.24 app/models/page_part.rb
trusty-cms-1.1.23 app/models/page_part.rb
trusty-cms-1.1.22 app/models/page_part.rb
trusty-cms-1.1.21 app/models/page_part.rb
trusty-cms-1.1.20 app/models/page_part.rb
trusty-cms-1.1.19 app/models/page_part.rb
trusty-cms-1.1.18 app/models/page_part.rb
trusty-cms-1.1.17 app/models/page_part.rb
trusty-cms-1.1.16 app/models/page_part.rb
trusty-cms-1.1.15 app/models/page_part.rb
trusty-cms-1.1.14 app/models/page_part.rb
trusty-cms-1.1.13 app/models/page_part.rb
trusty-cms-1.1.12 app/models/page_part.rb
trusty-cms-1.1.11 app/models/page_part.rb