Module: Model::UserTag

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

Instance Method Summary collapse

Instance Method Details

#remove_from_wechatObject



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

def remove_from_wechat
  wechat_api.tag_del_user(tag.tag_id, open_id) if wechat_api
end

#sync_create_laterObject



19
20
21
# File 'app/models/wechat/model/user_tag.rb', line 19

def sync_create_later
  UserTagJob.perform_later(self)
end

#sync_to_wechatObject



23
24
25
26
27
# File 'app/models/wechat/model/user_tag.rb', line 23

def sync_to_wechat
  if wechat_api
    wechat_api.tag_add_user(tag.tag_id, wechat_user.uid)
  end
end

#wechat_apiObject



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

def wechat_api
  @wechat_api ||= app&.api
end