Skip to content

Commit

Permalink
[Fix #531] Revert fund_source to fund_source_id.
Browse files Browse the repository at this point in the history
  • Loading branch information
k1T4eR committed Jan 25, 2018
1 parent 58d7309 commit 4d4ed24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -44,7 +44,7 @@ app.controller 'WithdrawsController', ['$scope', '$stateParams', '$http', '$gon'
@createWithdraw = (currency) ->
withdraw_channel = WithdrawChannel.findBy('currency', currency)
account = withdraw_channel.account()
data = { withdraw: { member_id: current_user.id, currency: currency, sum: @withdraw.sum, fund_source: _selectedFundSourceId } }
data = { withdraw: { member_id: current_user.id, currency: currency, sum: @withdraw.sum, fund_source_id: _selectedFundSourceId } }

$('.form-submit > input').attr('disabled', 'disabled')

Expand Down
6 changes: 3 additions & 3 deletions app/models/concerns/fund_sourceable.rb
Expand Up @@ -2,13 +2,13 @@ module FundSourceable
extend ActiveSupport::Concern

included do
attr_accessor :fund_source
attr_accessor :fund_source_id
before_validation :set_fund_source_attributes, on: :create
validates :fund_source, presence: true, on: :create
validates :fund_source_id, presence: true, on: :create
end

def set_fund_source_attributes
if fs = FundSource.find_by(id: fund_source)
if fs = FundSource.find_by(id: fund_source_id)
self.fund_extra = fs.extra
self.fund_uid = fs.uid.strip
end
Expand Down

0 comments on commit 4d4ed24

Please sign in to comment.