# Table name: user_blocks
#
# id :integer not null, primary key
-# user_id :bigint(8) not null
-# creator_id :bigint(8) not null
+# user_id :integer not null
+# creator_id :integer not null
# reason :text not null
# ends_at :datetime not null
# needs_view :boolean default(FALSE), not null
-# revoker_id :bigint(8)
+# revoker_id :integer
# created_at :datetime
# updated_at :datetime
# reason_format :enum default("markdown"), not null
class UserBlock < ActiveRecord::Base
validate :moderator_permissions
- validates :reason, :invalid_chars => true
+ validates :reason, :characters => true
belongs_to :user, :class_name => "User", :foreign_key => :user_id
belongs_to :creator, :class_name => "User", :foreign_key => :creator_id