From 087cef15f2af78b1b75d51e8b1c9e5a6b327179a Mon Sep 17 00:00:00 2001 From: Christopher Blanchard Date: Fri, 22 May 2015 13:56:25 +0100 Subject: [PATCH] Removed unused accessors and validation --- app/models/ban.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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