summaryrefslogtreecommitdiff
path: root/app/models/intruder.rb
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-02-11 13:04:05 +0100
committerspag <spag@golwen.net>2013-02-11 13:04:05 +0100
commit62ac01a8ea536718734bd911fc3642c0bd8b6bc7 (patch)
treead6b87372acd1ee231a0aa9bad3a24622c85a564 /app/models/intruder.rb
parent84ce49fcd057284225474c3197268a9f8a3c8121 (diff)
ipwhois added
Diffstat (limited to 'app/models/intruder.rb')
-rw-r--r--app/models/intruder.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/intruder.rb b/app/models/intruder.rb
index c013ee8..db14bf8 100644
--- a/app/models/intruder.rb
+++ b/app/models/intruder.rb
@@ -17,6 +17,17 @@ class Intruder < ActiveRecord::Base
before_validation :set_key_if_empty
+
+ def whois
+ if ! self.contact_ip.blank?
+ begin
+ return Whois.whois(self.contact_ip)
+ rescue
+ return nil
+ end
+ end
+ end
+
private
def set_key_if_empty
if self.key.blank?