Class: Survey
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Survey
- Defined in:
- app/models/survey.rb
Overview
the survey model
very simple at this stage : a survey belongs to a user
Instance Method Summary collapse
-
#update_metas ⇒ Object
updates the metas after a survey has been successfully sent to customer.
Instance Method Details
#update_metas ⇒ Object
updates the metas after a survey has been successfully sent to customer
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/models/survey.rb', line 16 def ={} if self. =ActiveSupport::JSON.decode(self.) ["sent"]+=1 else ["sent"]=1 end self.=ActiveSupport::JSON.encode() puts("*************adjusting surveys #{self.id} metas to #{self.}***************") if self.save result=true else result=false end result end |