Class: Satisfaction

Inherits:
ApplicationRecord show all
Defined in:
app/models/satisfaction.rb

Overview

the satisfaction model

Instance Method Summary collapse

Instance Method Details

#calc_meta(folder = nil, client = nil) ⇒ Object

return the meta table for the satisfaction feedback



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/models/satisfaction.rb', line 19

def calc_meta(folder=nil,client=nil)
  unless folder
    folder=Folder.find_by_id(self.folder_id)
  end
  unless folder.case_number == ""
    title="#{folder.name} (#{folder.case_number})"
  else
    title=folder.name
  end
  owner=User.find_by_id(folder.user_id)
  unless client
    client=User.find_by_id(self.user_id)
  end
  result=[]
  result.push(title)
  result.push(" - #{Validations.client_pattern}: ")
  result.push(client.email)
  result.push(" - #{Validations.project_manager_pattern}: ")
  result.push(owner.email)
  result
end

#get_meta_i18nObject

meta translation



43
44
45
46
47
# File 'app/models/satisfaction.rb', line 43

def get_meta_i18n
  self.case_number[Validations.client_pattern] = I18n.t("sb.client")
  self.case_number[Validations.project_manager_pattern] = I18n.t("sb.project_manager")
  self.case_number
end