的ActiveRecord :: UnknownAttributeError

时间:2015-06-18 15:08:55

标签: ruby-on-rails ruby activerecord

您好我在github上分叉了一个rails应用程序,我在这里得到一个ActiveRecord :: UnknownAttributeError是完整的错误日志screencap of error log

错误日志引用此控制器

module Deposits
  module CtrlBankable
    extend ActiveSupport::Concern

    included do
      before_filter :fetch
    end

    def create
      @deposit = model_kls.new(deposit_params)

      if @deposit.save
        render nothing: true
       else
        render text: @deposit.errors.full_messages.join, status: 403
      end
    end

    def destroy
      @deposit = current_user.deposits.find(params[:id])
      @deposit.cancel!
      render nothing: true
    end

    private

    def fetch
       @account = current_user.get_account(channel.currency)
       @model = model_kls
      @fund_sources =  current_user.fund_sources.with_currency(channel.currency)
      @assets = model_kls.where(member: current_user).order(:id).reverse_order.limit(10)
    end

    def deposit_params
      params[:deposit][:currency] = channel.currency
      params[:deposit][:member_id] = current_user.id
      params[:deposit][:account_id] = @account.id
      params.require(:deposit).permit(:fund_source, :amount, :currency, :account_id, :member_id)
    end
  end
end

0 个答案:

没有答案