ledger_accountable 0.0.4.pre → 0.0.5.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4794daeb706e70aad2fee44a919d9e3662a90626de32c800f83f50cca233f292
4
- data.tar.gz: 0b9b5328f240de5a0f981ef4e9377116270c266a0ebf902e414d7530635f3065
3
+ metadata.gz: a4d8258d74e78940001a6017772df0823788a51a4d7351776e8da084ec1e1a49
4
+ data.tar.gz: a798ff75abf3860b1a12e62e6eb9e51d53cc7210f7cdd8da8f33aa880ff86637
5
5
  SHA512:
6
- metadata.gz: b0b64654c3e52db811b11a06c4448e7f8bc6b99aab84c9f3614dfb773f1211bbf9ca6030eca0795d979bbdbaf5f7ecb8c0611d7afede41d3106fa76f9376ef7e
7
- data.tar.gz: 3e04be4d764af038e55173a9389efcec50eeded14641014a4ae50de728560eafdcfecad286fb2a2804872f3169fa54a7f44b998db632a9e1b699cb536da2892a
6
+ metadata.gz: 37f453f5fbcd0203b46fae44f3e064b725bff016f7e9da79111bd29b7a46a9c1654056be9f235c68127659f68884bba2c224bc50b8f5da309629b14ff013ee2c
7
+ data.tar.gz: 60a703495fe59638a5d48bd1596eaf15707d37970c050d7c2375e5267270d2502fc967809b04c3b74957115e63fe7f69d47751392cbbd1424f42d6f1d4650783
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LedgerAccountable
4
- VERSION = "0.0.4.pre".freeze
4
+ VERSION = "0.0.5.pre".freeze
5
5
  end
@@ -153,7 +153,7 @@ module LedgerAccountable
153
153
  raise NotImplementedError, "Implement #{self.class.ledger_amount_attribute} in #{self.class.name}"
154
154
  end
155
155
 
156
- ledger_amount_multiplier = self.class.ledger_type == :debit ? 1 : -1
156
+ ledger_amount_multiplier = self.class.ledger_type == :credit ? 1 : -1
157
157
  ledger_amount_multiplier * (send(self.class.ledger_amount_attribute) || 0.0)
158
158
  end
159
159
 
@@ -161,7 +161,7 @@ module LedgerAccountable
161
161
  # stored on the LedgerAccountable object
162
162
  def net_ledger_amount
163
163
  previous_ledger_amount = attribute_was(self.class.ledger_amount_attribute)
164
- ledger_amount_multiplier = self.class.ledger_type == :debit ? 1 : -1
164
+ ledger_amount_multiplier = self.class.ledger_type == :credit ? 1 : -1
165
165
  ledger_amount_multiplier * (ledger_amount - (previous_ledger_amount || 0.0))
166
166
  end
167
167
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledger_accountable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.pre
4
+ version: 0.0.5.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brendan Maclean