Sha256: 186061c1b0c2090b7b850dbbb343d1d10ada156f375e57f6545697a83ac0572e

Contents?: true

Size: 677 Bytes

Versions: 13

Compression:

Stored size: 677 Bytes

Contents

class Snippet < ActiveRecord::Base
  
  # Default Order
  default_scope :order => 'name'
  
  # Associations
  belongs_to :created_by, :class_name => 'User'
  belongs_to :updated_by, :class_name => 'User'

  # 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_format_of :name, :with => %r{^\S*$}, :message => 'cannot contain spaces or tabs'
  validates_uniqueness_of :name, :message => 'name already in use'
  
  object_id_attr :filter, TextFilter

end

Version data entries

13 entries across 13 versions & 3 rubygems

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