Module: Model::TemplateConfig
- Extended by:
- ActiveSupport::Concern
- Included in:
- Wechat::TemplateConfig
- Defined in:
- app/models/wechat/model/template_config.rb
Instance Method Summary collapse
- #content ⇒ Object
- #data_hash ⇒ Object
- #kid_list ⇒ Object
- #notify_setting ⇒ Object
- #sync_key_words ⇒ Object
Instance Method Details
#content ⇒ Object
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_hash ⇒ Object
29 30 31 |
# File 'app/models/wechat/model/template_config.rb', line 29 def data_hash {} end |
#kid_list ⇒ Object
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_setting ⇒ Object
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_words ⇒ Object
37 38 |
# File 'app/models/wechat/model/template_config.rb', line 37 def sync_key_words end |