client_management/app/models/site_request.rb

43 lines
1.1 KiB
Ruby
Raw Normal View History

2017-03-07 09:37:28 +00:00
class SiteRequest
include Mongoid::Document
include Mongoid::Timestamps
include Slug
field :site_id
field :host_with_rulingdigital, type: Boolean, default: false
field :server_details
2017-03-27 07:15:25 +00:00
field :maintenance, type: Boolean, default: false
field :maintenance_years, type: Integer
2017-03-07 09:37:28 +00:00
field :optional_modules, type: Array, default: []
field :custom_module, type: Boolean, default: false
field :custom_module_details
field :template_number
field :custom_template, type: Boolean, default: false
field :custom_template_details
field :rwd, type: Boolean, default: false
field :sites_to_add, type: Array, default: []
field :sites_added, type: Array, default: []
2017-03-07 09:37:28 +00:00
field :completed, type: Boolean, :default => false
field :type
belongs_to :site_purchase
belongs_to :request_contract
belongs_to :c_panel_user
def get_site
2017-09-19 08:58:10 +00:00
self.site_id == "newsite" ? nil : (RegisteredSite.find(self.site_id) rescue nil)
2017-03-07 09:37:28 +00:00
end
def get_request_type
2017-03-07 09:37:28 +00:00
case self.type
when "newsite"
t = "New Site"
when "existing"
t = "New Feature"
when "addsites"
t = "Sites Addition"
end
t
end
end