mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
Add initial models and corresponding test files
This commit is contained in:
parent
bca4470643
commit
542ea5101e
28 changed files with 548 additions and 8 deletions
4
app/models/address.rb
Normal file
4
app/models/address.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
class Address < ActiveRecord::Base
|
||||
belongs_to :contact
|
||||
belongs_to :country
|
||||
end
|
3
app/models/contact.rb
Normal file
3
app/models/contact.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Contact < ActiveRecord::Base
|
||||
has_many :addresses
|
||||
end
|
3
app/models/country.rb
Normal file
3
app/models/country.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Country < ActiveRecord::Base
|
||||
|
||||
end
|
7
app/models/domain.rb
Normal file
7
app/models/domain.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class Domain < ActiveRecord::Base
|
||||
belongs_to :registrar
|
||||
belongs_to :ns_set
|
||||
belongs_to :owner_contact, class_name: 'Contact'
|
||||
belongs_to :technical_contact, class_name: 'Contact'
|
||||
belongs_to :admin_contact, class_name: 'Contact'
|
||||
end
|
3
app/models/nameserver.rb
Normal file
3
app/models/nameserver.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Nameserver < ActiveRecord::Base
|
||||
has_and_belongs_to_many :ns_sets
|
||||
end
|
5
app/models/ns_set.rb
Normal file
5
app/models/ns_set.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class NsSet < ActiveRecord::Base
|
||||
belongs_to :registrar
|
||||
has_many :domains
|
||||
has_and_belongs_to_many :nameservers
|
||||
end
|
5
app/models/registrar.rb
Normal file
5
app/models/registrar.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Registrar < ActiveRecord::Base
|
||||
belongs_to :country
|
||||
has_many :domains
|
||||
has_many :ns_sets
|
||||
end
|
3
app/models/right.rb
Normal file
3
app/models/right.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Right < ActiveRecord::Base
|
||||
has_and_belongs_to_many :roles
|
||||
end
|
4
app/models/role.rb
Normal file
4
app/models/role.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
class Role < ActiveRecord::Base
|
||||
has_many :users
|
||||
has_and_belongs_to_many :rights
|
||||
end
|
3
app/models/user.rb
Normal file
3
app/models/user.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class User < ActiveRecord::Base
|
||||
belongs_to :role
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue