]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user_block.rb
Add links to the ToU and include them in signup
[rails.git] / app / models / user_block.rb
index f56f87b9de255408ed72fb0d0a7044103c9591d0..27bc40498b90ba455006ffd054a2eadbb3e7d60f 100644 (file)
@@ -3,12 +3,12 @@
 # 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
   belongs_to :revoker, :class_name => "User", :foreign_key => :revoker_id
 
-  PERIODS = USER_BLOCK_PERIODS
+  PERIODS = Settings.user_block_periods
 
   ##
   # scope to match active blocks