channel.rb 386 B

1234567891011121314
  1. class Channel < ActiveRecord::Base
  2. attr_accessible :bot_id, :name, :activate
  3. # Relation
  4. belongs_to :bot
  5. # Validation
  6. validates :name, :presence => true, :format => { :with => /\A#.+\z/,
  7. :message => "Channel name must begin with #" }
  8. validates_presence_of :bot_id
  9. validates_presence_of :bot_id, :on => :update
  10. end