saurabhbhatia / microworld

An MIS for Microcredit Organizations and Self Help Groups
http://www.touchonelife.org/
14 stars 1 forks source link

Prevent storing zero amount of refund in DB #8

Open naruvimama opened 13 years ago

naruvimama commented 13 years ago

In my working version I noticed that on the refund page Given that only few of the individuals are taking a refund The fields of the others are empty

Now only the refunds taken have to be taken and the line if params["#{user.id}"][:amount] # in the file refund_controller.rb , method create is supposed to handle it, However it doesn't seem to do so in mine

so I changed it to if !(params["#{user.id}"][:amount].to_i.zero?)

and it seems to work because irespective of it is "0",0.0 or nil it throws false

please let me know if the solution is right or if I am missing something

naruvimama commented 13 years ago

Similar problems with Ledger too