Sha256: 75e358f3779207bc800d2e73c95a0636192962250d75da12cb13a7c92c7b53fc

Contents?: true

Size: 668 Bytes

Versions: 13

Compression:

Stored size: 668 Bytes

Contents

class PagePart < ActiveRecord::Base
  
  # Default Order
  default_scope :order => 'name'
  
  # Associations
  belongs_to :page
  
  # Validations
  validates_presence_of :name, :message => 'required'
  validates_length_of :name, :maximum => 100, :message => '{{count}}-character limit'
  validates_length_of :filter_id, :maximum => 25, :allow_nil => true, :message => '{{count}}-character limit'
  validates_numericality_of :id, :page_id, :allow_nil => true, :only_integer => true, :message => 'must be a number'
  
  object_id_attr :filter, TextFilter

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

end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
radiantcms-couchrest_model-0.2.4 app/models/page_part.rb
radiantcms-couchrest_model-0.2.2 app/models/page_part.rb
radiantcms-couchrest_model-0.2.1 app/models/page_part.rb
radiantcms-couchrest_model-0.2 app/models/page_part.rb
radiantcms-couchrest_model-0.1.9 app/models/page_part.rb
radiantcms-couchrest_model-0.1.8 app/models/page_part.rb
radiantcms-couchrest_model-0.1.7 app/models/page_part.rb
radiantcms-couchrest_model-0.1.6 app/models/page_part.rb
radiantcms-couchrest_model-0.1.5 app/models/page_part.rb
radiant-0.8.2 app/models/page_part.rb
radiant-rc-0.9.0 app/models/page_part.rb
radiant-0.8.1 app/models/page_part.rb
radiant-0.8.0 app/models/page_part.rb