ban.rb 376 B

1234567891011121314151617
  1. class Ban < ActiveRecord::Base
  2. attr_accessible :frequency_id, :hostmask, :reason, :valid_from, :valid_to, :activate
  3. # Relation
  4. belongs_to :frequency
  5. # Validation
  6. validates_presence_of :frequency_id
  7. validates_presence_of :frequency_id, :on => :update
  8. validates :hostmask,
  9. :presence => true
  10. validates :reason,
  11. :presence => true
  12. end