From 5fd33b62f89d9a3f198c1c1f9f13a2f19b591813 Mon Sep 17 00:00:00 2001 From: spen Date: Wed, 11 Feb 2015 16:13:31 +0800 Subject: [PATCH] fix amount check --- app/controllers/nkuht_donates_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/nkuht_donates_controller.rb b/app/controllers/nkuht_donates_controller.rb index a673335..ac08553 100644 --- a/app/controllers/nkuht_donates_controller.rb +++ b/app/controllers/nkuht_donates_controller.rb @@ -55,20 +55,20 @@ class NkuhtDonatesController < ApplicationController @nkuht_donate.donation_serial_number = NkuhtDonateMain.get_serial_number @nkuht_donate.donation_payment_number = NkuhtDonateMain.get_payment_number - - if @nkuht_donate.donation_amount < '1' + + if @nkuht_donate.donation_amount.to_i < 1 @notice = [] @notice << t('nkuht_donate.donation_amount_err') redirect_to "#{params[:referer_url]}", :notice => @notice - elsif @nkuht_donate.donation_way == '2' and @nkuht_donate.donation_amount > '30000' + elsif @nkuht_donate.donation_way == '2' and @nkuht_donate.donation_amount.to_i > 30000 @notice = [] @notice << t('nkuht_donate.donation_amount_atm') redirect_to "#{params[:referer_url]}", :notice => @notice - elsif @nkuht_donate.donation_way == '3' and @nkuht_donate.donation_amount > '20000' + elsif @nkuht_donate.donation_way == '3' and @nkuht_donate.donation_amount.to_i > 20000 @notice = [] @notice << t('nkuht_donate.donation_amount_market')