diff --git a/app/models/ban.rb b/app/models/ban.rb index e234580..5a7eaf9 100644 --- a/app/models/ban.rb +++ b/app/models/ban.rb @@ -27,13 +27,12 @@ class Ban < ActiveRecord::Base VENT_BANS = "tmp/bans.txt" attr_protected :id, :created_at, :updated_at - attr_accessor :ts, :sign, :len, :user_name + attr_accessor :len, :user_name scope :ordered, order: "created_at DESC" scope :effective, conditions: "expiry > UTC_TIMESTAMP()" scope :ineffective, conditions: "expiry < UTC_TIMESTAMP()" - validate :validate_ts validate :validate_type validate :validate_ventban validates_format_of :steamid, with: /\A([0-9]{1,10}:){2}[0-9]{1,10}\Z/, allow_blank: true @@ -58,12 +57,6 @@ class Ban < ActiveRecord::Base TYPE_GATHER => "Gather"} end - def validate_ts - if ts and Verification.verify(steamid + ts.to_s) != sign - errors.add :ts, I18n.t(:wrong_verification_code) - end - end - def validate_type errors.add :ban_type, I18n.t(:invalid_ban_type) unless types.include? ban_type end