Module: Model::Account
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/wechat/model/account.rb
Instance Method Summary collapse
Instance Method Details
#invoke_effect(wechat_user) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/models/wechat/model/account.rb', line 10 def invoke_effect(wechat_user) old_account = wechat_user.account if old_account == self "您的微信账号已经绑定到账号 #{identity} 了" elsif old_account old_account.access_tokens.delete_all # 更改绑定关系后,old account 登陆失效 "您的微信账号已更换绑定账号, 之前绑定的账号是#{old_account.identity}, 已经绑定到#{identity}" else "您的微信账号绑定至账号 #{identity} 成功" end end |