From 67519a46f491e5fec3e72e9b104eb8ed19dc039e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andres=20Keskk=C3=BCla?= Date: Mon, 8 Dec 2014 16:03:40 +0200 Subject: [PATCH] Added private and public whois, refactored to dir --- app/models/whois/whois_private_domain.rb | 3 +++ app/models/whois/whois_private_server.rb | 4 ++++ app/models/whois/whois_public_domain.rb | 3 +++ app/models/whois/whois_public_server.rb | 4 ++++ app/models/whois_domain.rb | 3 --- app/models/whois_server.rb | 4 ---- doc/whois.rm | 13 +++---------- 7 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 app/models/whois/whois_private_domain.rb create mode 100644 app/models/whois/whois_private_server.rb create mode 100644 app/models/whois/whois_public_domain.rb create mode 100644 app/models/whois/whois_public_server.rb delete mode 100644 app/models/whois_domain.rb delete mode 100644 app/models/whois_server.rb diff --git a/app/models/whois/whois_private_domain.rb b/app/models/whois/whois_private_domain.rb new file mode 100644 index 000000000..2a43a79b6 --- /dev/null +++ b/app/models/whois/whois_private_domain.rb @@ -0,0 +1,3 @@ +class WhoisDomain < WhoisPrivateServer + self.table_name = 'domains' +end diff --git a/app/models/whois/whois_private_server.rb b/app/models/whois/whois_private_server.rb new file mode 100644 index 000000000..74c635cd2 --- /dev/null +++ b/app/models/whois/whois_private_server.rb @@ -0,0 +1,4 @@ +class WhoisPrivateServer < ActiveRecord::Base + self.abstract_class = true + establish_connection :"#{Rails.env}_private_whois" +end diff --git a/app/models/whois/whois_public_domain.rb b/app/models/whois/whois_public_domain.rb new file mode 100644 index 000000000..4b2eb49c3 --- /dev/null +++ b/app/models/whois/whois_public_domain.rb @@ -0,0 +1,3 @@ +class WhoisDomain < WhoisPublicServer + self.table_name = 'domains' +end diff --git a/app/models/whois/whois_public_server.rb b/app/models/whois/whois_public_server.rb new file mode 100644 index 000000000..fb14b1ea5 --- /dev/null +++ b/app/models/whois/whois_public_server.rb @@ -0,0 +1,4 @@ +class WhoisPublicServer < ActiveRecord::Base + self.abstract_class = true + establish_connection :"#{Rails.env}_public_whois" +end diff --git a/app/models/whois_domain.rb b/app/models/whois_domain.rb deleted file mode 100644 index 3a38465bd..000000000 --- a/app/models/whois_domain.rb +++ /dev/null @@ -1,3 +0,0 @@ -class WhoisDomain < WhoisServer - self.table_name = 'domains' -end diff --git a/app/models/whois_server.rb b/app/models/whois_server.rb deleted file mode 100644 index 5892f7891..000000000 --- a/app/models/whois_server.rb +++ /dev/null @@ -1,4 +0,0 @@ -class WhoisServer < ActiveRecord::Base - self.abstract_class = true - establish_connection :"#{Rails.env}_whois" -end diff --git a/doc/whois.rm b/doc/whois.rm index f04702f6a..aaa45b87c 100644 --- a/doc/whois.rm +++ b/doc/whois.rm @@ -6,17 +6,10 @@ that disables whois (effects should fully be loaded after restarting the app) What whois_enabled=false does is that the whois callback does not get included. Delayed jobs migration and everything else will still be installed tho. -If you wish to use the whois module, tho, you need a whois database looking something like this +Basic whois logic - we save whois data to 2 separate databases - whois private and public. +Those two databases are streamed to appropriate whois servers. -```ruby - create_table :domains do |t| - t.string :name - t.text :body - t.timestamps - end -``` - -NB! Migration with rake tasks is available in whois app repo. +NB! Migration with rake tasks for whois part of the code is available in whois app repo. For development, delayed_job queue can be handled by rake task `rake jobs:work` or if you wish to be fancy you can use a daemon with `bin/delayed_job start`