Sha256: e6ecb0f0d44bcfd0827f5efc8bf7dae8c9ecd3f6c31af4b4b3e52a40c8d10f72

Contents?: true

Size: 648 Bytes

Versions: 9

Compression:

Stored size: 648 Bytes

Contents

class Snippet < ActiveRecord::Base
  
  # Default Order
  order_by '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 => '%d-character limit'
  validates_length_of :filter_id, :maximum => 25, :allow_nil => true, :message => '%d-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

9 entries across 9 versions & 1 rubygems

Version Path
radiant-0.7.2 app/models/snippet.rb
radiant-0.6.5.1 app/models/snippet.rb
radiant-0.6.5 app/models/snippet.rb
radiant-0.6.6 app/models/snippet.rb
radiant-0.6.7 app/models/snippet.rb
radiant-0.6.9 app/models/snippet.rb
radiant-0.6.8 app/models/snippet.rb
radiant-0.7.0 app/models/snippet.rb
radiant-0.7.1 app/models/snippet.rb