Skip to content

Commit

Permalink
Change old style hash expression
Browse files Browse the repository at this point in the history
  • Loading branch information
kaznum committed Oct 3, 2013
1 parent f541c54 commit 1cc984a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script/monthly_profit_loss_checker.rb
Expand Up @@ -8,9 +8,9 @@
month_from = mpl.month.beginning_of_month
month_to = mpl.month.end_of_month

items_of_terms = u.items.where(:action_date => month_from..month_to)
amount_from = items_of_terms.where(:from_account_id => mpl.account_id).sum(:amount) || 0
amount_to = items_of_terms.where(:to_account_id => mpl.account_id).sum(:amount) || 0
items_of_terms = u.items.where(action_date: month_from..month_to)
amount_from = items_of_terms.where(from_account_id: mpl.account_id).sum(:amount) || 0
amount_to = items_of_terms.where(to_account_id: mpl.account_id).sum(:amount) || 0

amount = amount_to - amount_from

Expand Down

0 comments on commit 1cc984a

Please sign in to comment.