Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charges Overview Error #208

Open
arakla opened this issue May 3, 2016 · 3 comments
Open

Charges Overview Error #208

arakla opened this issue May 3, 2016 · 3 comments

Comments

@arakla
Copy link
Member

arakla commented May 3, 2016

One of the columns, either Pending Charges or Total is not always accurate. I think pending charges doesn't actually total all pending charges.

@brucethesloth
Copy link

@arakla Could you be more descriptive of the problem? i.e. Does this happen on the charges page? Thanks!

@pkoenig10
Copy link
Member

pkoenig10 commented Mar 6, 2017

I'm pretty sure the issue @arakla noticed was as result of not accounting for the case when the is_approved scope for a charge is nil, rather than 'true' or 'false'. See app/models/charge.rb.

This is an issue that probably exists in multiple places (see my fix for another instance here) and in fixing this issue we should go through all models to fix this wherever it occurs.

I don't really like the solution I used in that commit. We really should fix this by either:

  1. Using where.not. This is not the best solution because it not clear to contributors not familiar with this issue why that needs to be used and will likely result in this issue reappearing in the future.
  2. Enforcing this non-nullability in the SQL schema and use default values. I think this is the correct way to solve the problem. The SQL schema provides a declarative way to define these constraints.

@arakla
Copy link
Member Author

arakla commented Mar 6, 2017

I am referring to the charge overview view, which is located here: https://[Server]/charge_overview
The view is located here: binder-app/app/views/home/charge_overview.html.erb

And what @pkoenig10 points out sounds like the culprit.

As mentioned in #215, it is not referenced anywhere and is effectively just passed on by word of mouth or looking at the code (which is a separate issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants