separated out ip ban logic from regular bans, users can no longer register if an ip ban is in place
This commit is contained in:
9
app/models/ip_ban.rb
Normal file
9
app/models/ip_ban.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class IpBan < ActiveRecord::Base
|
||||
belongs_to :creator, :class_name => "User"
|
||||
validates_presence_of :reason
|
||||
validates_uniqueness_of :ip_addr
|
||||
|
||||
def self.is_banned?(ip_addr)
|
||||
exists?(["ip_addr = ?", ip_addr])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user