ledger_accountable 0.0.3.pre → 0.0.4.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: 5072aa4e2db505396bb59a25bbc5ab2fb40e30b0286002b232f988554fc1167b
4
- data.tar.gz: 7a213bbaa196aaa6e8225aa9f0e6f1e4af81ce686b4a4b2a835d279eb424b09e
3
+ metadata.gz: 4794daeb706e70aad2fee44a919d9e3662a90626de32c800f83f50cca233f292
4
+ data.tar.gz: 0b9b5328f240de5a0f981ef4e9377116270c266a0ebf902e414d7530635f3065
5
5
  SHA512:
6
- metadata.gz: 0a36f896a3dc8ae48e1933d33e44de9e350daf57570b46a832144fb512538a2bf5ad7bc9cecdd79b2f0099413a82d81acb534ec1636b7d26006c087832a92d3a
7
- data.tar.gz: ea0fb2fcb902883acb6f6cd7e45b07e214ed771f2d56bd0389f754bb99ee371a2016081bdc255f44ef61954fe3205fbb2297c2bf71c154cfbef4ea660fb87301
6
+ metadata.gz: b0b64654c3e52db811b11a06c4448e7f8bc6b99aab84c9f3614dfb773f1211bbf9ca6030eca0795d979bbdbaf5f7ecb8c0611d7afede41d3106fa76f9376ef7e
7
+ data.tar.gz: 3e04be4d764af038e55173a9389efcec50eeded14641014a4ae50de728560eafdcfecad286fb2a2804872f3169fa54a7f44b998db632a9e1b699cb536da2892a
@@ -9,7 +9,7 @@ class LedgerEntry < ApplicationRecord
9
9
 
10
10
  store :metadata, coder: JSON
11
11
 
12
- validates :amount, presence: true
12
+ validates :amount_cents, presence: true
13
13
  validates :entry_type, presence: true
14
14
 
15
15
  def to_itemized_s(line_type = :line)
@@ -4,7 +4,7 @@ class CreateLedgerEntries < ActiveRecord::Migration[6.1]
4
4
  t.references :owner, polymorphic: true, null: false
5
5
  t.references :ledger_item, polymorphic: true, null: false
6
6
  t.integer :entry_type, null: false
7
- t.decimal :amount, precision: 10, scale: 2, default: 0.0, null: false
7
+ t.integer :amount_cents, default: 0, null: false
8
8
  t.text :metadata
9
9
 
10
10
  t.timestamps
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LedgerAccountable
4
- VERSION = "0.0.3.pre".freeze
4
+ VERSION = "0.0.4.pre".freeze
5
5
  end
@@ -286,7 +286,7 @@ module LedgerAccountable
286
286
  owner: owner,
287
287
  ledger_item: self,
288
288
  entry_type: entry_type,
289
- amount: amount,
289
+ amount_cents: amount,
290
290
  metadata: metadata
291
291
  )
292
292
  rescue ActiveRecord::RecordInvalid => e
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.3.pre
4
+ version: 0.0.4.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brendan Maclean