Sha256: de31797ebc464622ba2fbc4f4d4400cada3e405139219e8db02ad0a0399b274b

Contents?: true

Size: 503 Bytes

Versions: 1

Compression:

Stored size: 503 Bytes

Contents

class Person < ActiveRecord::Base
	usesguid

	has_many :elts
	has_many :choices
	has_many :issues, :through => :choices, :source => :elt

	validates_presence_of :name, :on => :create
	validates_length_of :name, :within => 3..40, :on => :create
  validates_uniqueness_of :name, :on => :create
  validates_uniqueness_of :email, :on => :create,
		:if => Proc.new { |p| p.email and p.email.length > 0 }

	has_and_belongs_to_many :subscribed_elts,
		:class_name => "Elt",
		:join_table => "subscribers"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parlement-0.5 app/models/person.rb