mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Added private and public whois, refactored to dir
This commit is contained in:
parent
3c5563b9a9
commit
67519a46f4
7 changed files with 17 additions and 17 deletions
3
app/models/whois/whois_private_domain.rb
Normal file
3
app/models/whois/whois_private_domain.rb
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
class WhoisDomain < WhoisPrivateServer
|
||||||
|
self.table_name = 'domains'
|
||||||
|
end
|
4
app/models/whois/whois_private_server.rb
Normal file
4
app/models/whois/whois_private_server.rb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
class WhoisPrivateServer < ActiveRecord::Base
|
||||||
|
self.abstract_class = true
|
||||||
|
establish_connection :"#{Rails.env}_private_whois"
|
||||||
|
end
|
3
app/models/whois/whois_public_domain.rb
Normal file
3
app/models/whois/whois_public_domain.rb
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
class WhoisDomain < WhoisPublicServer
|
||||||
|
self.table_name = 'domains'
|
||||||
|
end
|
4
app/models/whois/whois_public_server.rb
Normal file
4
app/models/whois/whois_public_server.rb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
class WhoisPublicServer < ActiveRecord::Base
|
||||||
|
self.abstract_class = true
|
||||||
|
establish_connection :"#{Rails.env}_public_whois"
|
||||||
|
end
|
|
@ -1,3 +0,0 @@
|
||||||
class WhoisDomain < WhoisServer
|
|
||||||
self.table_name = 'domains'
|
|
||||||
end
|
|
|
@ -1,4 +0,0 @@
|
||||||
class WhoisServer < ActiveRecord::Base
|
|
||||||
self.abstract_class = true
|
|
||||||
establish_connection :"#{Rails.env}_whois"
|
|
||||||
end
|
|
13
doc/whois.rm
13
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.
|
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.
|
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
|
NB! Migration with rake tasks for whois part of the code is available in whois app repo.
|
||||||
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.
|
|
||||||
|
|
||||||
For development, delayed_job queue can be handled by rake task
|
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`
|
`rake jobs:work` or if you wish to be fancy you can use a daemon with `bin/delayed_job start`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue