Module: Social::Balance
- Defined in:
- lib/social/balance.rb
Class Method Summary collapse
- .included(base) ⇒ Object deprecated Deprecated.
Class Method Details
.included(base) ⇒ Object
Deprecated.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/social/balance.rb', line 5 def self.included(base) base.instance_eval do include ::Balance::Observer with_balance :charge_off_callback => :charge_off_callback # Списание средств если нужно извещать 3ю сторону # TODO: переделать на транзакции def charge_off_callback(money) soc_type = Social.type_by_id() network = Social::Network(soc_type) #if network && network.respond_to?(:rate) && network.rate != 1 if soc_type.to_sym == :vk result = network.user.charge_off_balance(current_uid, money) end end end end |