Module: Model::TemplateConfig

Extended by:
ActiveSupport::Concern
Included in:
Wechat::TemplateConfig
Defined in:
app/models/wechat/model/template_config.rb

Instance Method Summary collapse

Instance Method Details

#contentObject



33
34
35
# File 'app/models/wechat/model/template_config.rb', line 33

def content
  super || template_key_words.where.not(mapping: [nil, '']).pluck(:name)
end

#data_hashObject



29
30
31
# File 'app/models/wechat/model/template_config.rb', line 29

def data_hash
  {}
end

#kid_listObject



25
26
27
# File 'app/models/wechat/model/template_config.rb', line 25

def kid_list
  template_key_words.where.not(mapping: [nil, '']).pluck(:kid)
end

#notify_settingObject



40
41
42
43
# File 'app/models/wechat/model/template_config.rb', line 40

def notify_setting
  r = RailsNotice.notifiable_types.dig(notifiable_type, self.code.to_sym) || {}
  r.fetch(:only, []).map(&->(o){ [notifiable_type.constantize.human_attribute_name(o), o] }).to_h
end

#sync_key_wordsObject



37
38
# File 'app/models/wechat/model/template_config.rb', line 37

def sync_key_words
end