double_entry 1.0.1 → 2.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +497 -0
- data/README.md +107 -44
- data/double_entry.gemspec +22 -49
- data/lib/active_record/locking_extensions.rb +3 -3
- data/lib/active_record/locking_extensions/log_subscriber.rb +1 -1
- data/lib/double_entry.rb +29 -21
- data/lib/double_entry/account.rb +39 -46
- data/lib/double_entry/account_balance.rb +20 -3
- data/lib/double_entry/balance_calculator.rb +5 -5
- data/lib/double_entry/configurable.rb +1 -0
- data/lib/double_entry/configuration.rb +8 -2
- data/lib/double_entry/errors.rb +13 -13
- data/lib/double_entry/line.rb +7 -6
- data/lib/double_entry/locking.rb +5 -5
- data/lib/double_entry/transfer.rb +37 -30
- data/lib/double_entry/validation.rb +1 -0
- data/lib/double_entry/validation/account_fixer.rb +36 -0
- data/lib/double_entry/validation/line_check.rb +25 -43
- data/lib/double_entry/version.rb +1 -1
- data/lib/generators/double_entry/install/install_generator.rb +22 -1
- data/lib/generators/double_entry/install/templates/initializer.rb +20 -0
- data/lib/generators/double_entry/install/templates/migration.rb +45 -55
- metadata +35 -256
- data/.gitignore +0 -32
- data/.rspec +0 -2
- data/.travis.yml +0 -29
- data/.yardopts +0 -2
- data/Gemfile +0 -2
- data/Rakefile +0 -15
- data/lib/double_entry/reporting.rb +0 -181
- data/lib/double_entry/reporting/aggregate.rb +0 -110
- data/lib/double_entry/reporting/aggregate_array.rb +0 -76
- data/lib/double_entry/reporting/day_range.rb +0 -42
- data/lib/double_entry/reporting/hour_range.rb +0 -45
- data/lib/double_entry/reporting/line_aggregate.rb +0 -16
- data/lib/double_entry/reporting/line_aggregate_filter.rb +0 -79
- data/lib/double_entry/reporting/month_range.rb +0 -94
- data/lib/double_entry/reporting/time_range.rb +0 -59
- data/lib/double_entry/reporting/time_range_array.rb +0 -49
- data/lib/double_entry/reporting/week_range.rb +0 -107
- data/lib/double_entry/reporting/year_range.rb +0 -40
- data/script/jack_hammer +0 -210
- data/script/setup.sh +0 -8
- data/spec/active_record/locking_extensions_spec.rb +0 -110
- data/spec/double_entry/account_balance_spec.rb +0 -7
- data/spec/double_entry/account_spec.rb +0 -130
- data/spec/double_entry/balance_calculator_spec.rb +0 -88
- data/spec/double_entry/configuration_spec.rb +0 -50
- data/spec/double_entry/line_spec.rb +0 -80
- data/spec/double_entry/locking_spec.rb +0 -214
- data/spec/double_entry/performance/double_entry_performance_spec.rb +0 -32
- data/spec/double_entry/performance/reporting/aggregate_performance_spec.rb +0 -50
- data/spec/double_entry/reporting/aggregate_array_spec.rb +0 -123
- data/spec/double_entry/reporting/aggregate_spec.rb +0 -205
- data/spec/double_entry/reporting/line_aggregate_filter_spec.rb +0 -90
- data/spec/double_entry/reporting/line_aggregate_spec.rb +0 -39
- data/spec/double_entry/reporting/month_range_spec.rb +0 -139
- data/spec/double_entry/reporting/time_range_array_spec.rb +0 -169
- data/spec/double_entry/reporting/time_range_spec.rb +0 -45
- data/spec/double_entry/reporting/week_range_spec.rb +0 -103
- data/spec/double_entry/reporting_spec.rb +0 -181
- data/spec/double_entry/transfer_spec.rb +0 -93
- data/spec/double_entry/validation/line_check_spec.rb +0 -99
- data/spec/double_entry_spec.rb +0 -428
- data/spec/generators/double_entry/install/install_generator_spec.rb +0 -30
- data/spec/spec_helper.rb +0 -118
- data/spec/support/accounts.rb +0 -21
- data/spec/support/blueprints.rb +0 -43
- data/spec/support/database.example.yml +0 -21
- data/spec/support/database.travis.yml +0 -24
- data/spec/support/double_entry_spec_helper.rb +0 -27
- data/spec/support/gemfiles/Gemfile.rails-3.2.x +0 -8
- data/spec/support/gemfiles/Gemfile.rails-4.1.x +0 -6
- data/spec/support/gemfiles/Gemfile.rails-4.2.x +0 -5
- data/spec/support/gemfiles/Gemfile.rails-5.0.x +0 -5
- data/spec/support/performance_helper.rb +0 -26
- data/spec/support/reporting_configuration.rb +0 -6
- data/spec/support/schema.rb +0 -74
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DoubleEntry
|
4
|
+
module Validation
|
5
|
+
class AccountFixer
|
6
|
+
def recalculate_account(account)
|
7
|
+
DoubleEntry.lock_accounts(account) do
|
8
|
+
recalculated_balance = Money.zero(account.currency)
|
9
|
+
|
10
|
+
lines_for_account(account).each do |line|
|
11
|
+
recalculated_balance += line.amount
|
12
|
+
if line.balance != recalculated_balance
|
13
|
+
line.update_attribute(:balance, recalculated_balance)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
update_balance_for_account(account, recalculated_balance)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def lines_for_account(account)
|
24
|
+
Line.where(
|
25
|
+
account: account.identifier.to_s,
|
26
|
+
scope: account.scope_identity.to_s
|
27
|
+
).order(:id)
|
28
|
+
end
|
29
|
+
|
30
|
+
def update_balance_for_account(account, balance)
|
31
|
+
account_balance = Locking.balance_for_locked_account(account)
|
32
|
+
account_balance.update_attribute(:balance, balance)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -4,13 +4,16 @@ require 'set'
|
|
4
4
|
module DoubleEntry
|
5
5
|
module Validation
|
6
6
|
class LineCheck < ActiveRecord::Base
|
7
|
-
default_scope -> { order('created_at') }
|
8
7
|
|
9
|
-
def self.
|
10
|
-
|
8
|
+
def self.last_line_id_checked
|
9
|
+
order('created_at DESC').limit(1).pluck(:last_line_id).first || 0
|
11
10
|
end
|
12
11
|
|
13
|
-
def perform
|
12
|
+
def self.perform!(fixer: nil)
|
13
|
+
new.perform(fixer: fixer)
|
14
|
+
end
|
15
|
+
|
16
|
+
def perform(fixer: nil)
|
14
17
|
log = ''
|
15
18
|
current_line_id = nil
|
16
19
|
|
@@ -24,29 +27,24 @@ module DoubleEntry
|
|
24
27
|
end
|
25
28
|
|
26
29
|
active_accounts.each do |account|
|
27
|
-
incorrect_accounts << account
|
30
|
+
incorrect_accounts << account unless cached_balance_correct?(account, log)
|
28
31
|
end
|
29
32
|
|
30
|
-
incorrect_accounts.each
|
33
|
+
incorrect_accounts.each(&fixer.method(:recalculate_account)) if fixer
|
31
34
|
|
32
35
|
unless active_accounts.empty?
|
33
36
|
LineCheck.create!(
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
+
errors_found: incorrect_accounts.any?,
|
38
|
+
last_line_id: current_line_id,
|
39
|
+
log: log,
|
37
40
|
)
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
41
44
|
private
|
42
45
|
|
43
|
-
def last_run_line_id
|
44
|
-
latest = LineCheck.last
|
45
|
-
latest ? latest.last_line_id : 0
|
46
|
-
end
|
47
|
-
|
48
46
|
def new_lines_since_last_run
|
49
|
-
Line.
|
47
|
+
Line.with_id_greater_than(LineCheck.last_line_id_checked)
|
50
48
|
end
|
51
49
|
|
52
50
|
def running_balance_correct?(line, log)
|
@@ -88,39 +86,23 @@ module DoubleEntry
|
|
88
86
|
#{previous_line.inspect}
|
89
87
|
#{line.inspect}
|
90
88
|
|
91
|
-
|
92
|
-
end
|
93
|
-
|
94
|
-
def cached_balance_correct?(account)
|
95
|
-
DoubleEntry.lock_accounts(account) do
|
96
|
-
return AccountBalance.find_by_account(account).balance == account.balance
|
97
|
-
end
|
89
|
+
END_OF_MESSAGE
|
98
90
|
end
|
99
91
|
|
100
|
-
def
|
92
|
+
def cached_balance_correct?(account, log)
|
101
93
|
DoubleEntry.lock_accounts(account) do
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
94
|
+
cached_balance = AccountBalance.find_by_account(account).balance
|
95
|
+
running_balance = account.balance
|
96
|
+
correct = (cached_balance == running_balance)
|
97
|
+
log << <<~MESSAGE unless correct
|
98
|
+
*********************************
|
99
|
+
Error on account #{account}: #{cached_balance} (cached balance) != #{running_balance} (running balance)
|
100
|
+
*********************************
|
101
|
+
|
102
|
+
MESSAGE
|
103
|
+
return correct
|
110
104
|
end
|
111
105
|
end
|
112
|
-
|
113
|
-
def lines_for_account(account)
|
114
|
-
Line.where(
|
115
|
-
:account => account.identifier.to_s,
|
116
|
-
:scope => account.scope_identity.to_s,
|
117
|
-
).order(:id)
|
118
|
-
end
|
119
|
-
|
120
|
-
def update_balance_for_account(account, balance)
|
121
|
-
account_balance = Locking.balance_for_locked_account(account)
|
122
|
-
account_balance.update_attribute(:balance, balance)
|
123
|
-
end
|
124
106
|
end
|
125
107
|
end
|
126
108
|
end
|
data/lib/double_entry/version.rb
CHANGED
@@ -7,6 +7,8 @@ module DoubleEntry
|
|
7
7
|
class InstallGenerator < Rails::Generators::Base
|
8
8
|
include Rails::Generators::Migration
|
9
9
|
|
10
|
+
class_option :json_metadata, type: :boolean, default: true
|
11
|
+
|
10
12
|
source_root File.expand_path('../templates', __FILE__)
|
11
13
|
|
12
14
|
def self.next_migration_number(path)
|
@@ -14,7 +16,26 @@ module DoubleEntry
|
|
14
16
|
end
|
15
17
|
|
16
18
|
def copy_migrations
|
17
|
-
migration_template 'migration.rb', 'db/migrate/create_double_entry_tables.rb'
|
19
|
+
migration_template 'migration.rb', 'db/migrate/create_double_entry_tables.rb', migration_version: migration_version
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_initializer
|
23
|
+
template 'initializer.rb', 'config/initializers/double_entry.rb'
|
24
|
+
end
|
25
|
+
|
26
|
+
def json_metadata
|
27
|
+
# MySQL JSON support added to AR 5.0
|
28
|
+
if ActiveRecord.version.version < '5'
|
29
|
+
false
|
30
|
+
else
|
31
|
+
options[:json_metadata]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def migration_version
|
36
|
+
if ActiveRecord.version.version > '5'
|
37
|
+
"[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
|
38
|
+
end
|
18
39
|
end
|
19
40
|
end
|
20
41
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'double_entry'
|
2
|
+
|
3
|
+
DoubleEntry.configure do |config|
|
4
|
+
# Use json(b) column in double_entry_lines table to store metadata instead of separate metadata table
|
5
|
+
config.json_metadata = <%= json_metadata %>
|
6
|
+
|
7
|
+
# config.define_accounts do |accounts|
|
8
|
+
# user_scope = ->(user) do
|
9
|
+
# raise 'not a User' unless user.class.name == 'User'
|
10
|
+
# user.id
|
11
|
+
# end
|
12
|
+
# accounts.define(identifier: :savings, scope_identifier: user_scope, positive_only: true)
|
13
|
+
# accounts.define(identifier: :checking, scope_identifier: user_scope)
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# config.define_transfers do |transfers|
|
17
|
+
# transfers.define(from: :checking, to: :savings, code: :deposit)
|
18
|
+
# transfers.define(from: :savings, to: :checking, code: :withdraw)
|
19
|
+
# end
|
20
|
+
end
|
@@ -1,74 +1,64 @@
|
|
1
|
-
class CreateDoubleEntryTables < ActiveRecord::Migration
|
2
|
-
|
1
|
+
class CreateDoubleEntryTables < ActiveRecord::Migration<%= migration_version %>
|
3
2
|
def self.up
|
4
|
-
create_table "double_entry_account_balances"
|
5
|
-
t.string "account", :
|
6
|
-
t.string "scope"
|
7
|
-
t.
|
8
|
-
t.timestamps
|
3
|
+
create_table "double_entry_account_balances" do |t|
|
4
|
+
t.string "account", null: false
|
5
|
+
t.string "scope"
|
6
|
+
t.bigint "balance", null: false
|
7
|
+
t.timestamps null: false
|
9
8
|
end
|
10
9
|
|
11
|
-
add_index "double_entry_account_balances", ["account"], :
|
12
|
-
add_index "double_entry_account_balances", ["scope", "account"], :
|
10
|
+
add_index "double_entry_account_balances", ["account"], name: "index_account_balances_on_account"
|
11
|
+
add_index "double_entry_account_balances", ["scope", "account"], name: "index_account_balances_on_scope_and_account", unique: true
|
13
12
|
|
14
|
-
create_table "double_entry_lines"
|
15
|
-
t.string "account", :
|
16
|
-
t.string "scope"
|
17
|
-
t.string "code", :
|
18
|
-
t.
|
19
|
-
t.
|
20
|
-
t.
|
21
|
-
t.string "partner_account", :
|
22
|
-
t.string "partner_scope"
|
23
|
-
t.
|
24
|
-
|
25
|
-
|
13
|
+
create_table "double_entry_lines" do |t|
|
14
|
+
t.string "account", null: false
|
15
|
+
t.string "scope"
|
16
|
+
t.string "code", null: false
|
17
|
+
t.bigint "amount", null: false
|
18
|
+
t.bigint "balance", null: false
|
19
|
+
t.references "partner", index: false
|
20
|
+
t.string "partner_account", null: false
|
21
|
+
t.string "partner_scope"
|
22
|
+
t.references "detail", index: false, polymorphic: true
|
23
|
+
<%- if json_metadata -%>
|
24
|
+
if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
|
25
|
+
t.jsonb "metadata"
|
26
|
+
else
|
27
|
+
t.json "metadata"
|
28
|
+
end
|
29
|
+
<%- end -%>
|
30
|
+
t.timestamps null: false
|
26
31
|
end
|
27
32
|
|
28
|
-
add_index "double_entry_lines", ["account", "code", "created_at"], :
|
29
|
-
add_index "double_entry_lines", ["account", "created_at"], :
|
30
|
-
add_index "double_entry_lines", ["scope", "account", "created_at"], :
|
31
|
-
add_index "double_entry_lines", ["scope", "account", "id"], :
|
32
|
-
|
33
|
-
create_table "double_entry_line_aggregates", :force => true do |t|
|
34
|
-
t.string "function", :limit => 15, :null => false
|
35
|
-
t.string "account", :limit => 31, :null => false
|
36
|
-
t.string "code", :limit => 47
|
37
|
-
t.string "scope", :limit => 23
|
38
|
-
t.integer "year"
|
39
|
-
t.integer "month"
|
40
|
-
t.integer "week"
|
41
|
-
t.integer "day"
|
42
|
-
t.integer "hour"
|
43
|
-
t.integer "amount", :null => false
|
44
|
-
t.string "filter"
|
45
|
-
t.string "range_type", :limit => 15, :null => false
|
46
|
-
t.timestamps :null => false
|
47
|
-
end
|
33
|
+
add_index "double_entry_lines", ["account", "code", "created_at"], name: "lines_account_code_created_at_idx"
|
34
|
+
add_index "double_entry_lines", ["account", "created_at"], name: "lines_account_created_at_idx"
|
35
|
+
add_index "double_entry_lines", ["scope", "account", "created_at"], name: "lines_scope_account_created_at_idx"
|
36
|
+
add_index "double_entry_lines", ["scope", "account", "id"], name: "lines_scope_account_id_idx"
|
48
37
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
t.integer "last_line_id", :null => false
|
53
|
-
t.boolean "errors_found", :null => false
|
38
|
+
create_table "double_entry_line_checks" do |t|
|
39
|
+
t.references "last_line", null: false, index: false
|
40
|
+
t.boolean "errors_found", null: false
|
54
41
|
t.text "log"
|
55
|
-
t.timestamps
|
42
|
+
t.timestamps null: false
|
56
43
|
end
|
57
44
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
t.
|
45
|
+
add_index "double_entry_line_checks", ["created_at", "last_line_id"], name: "line_checks_created_at_last_line_id_idx"
|
46
|
+
<%- unless json_metadata -%>
|
47
|
+
|
48
|
+
create_table "double_entry_line_metadata" do |t|
|
49
|
+
t.references "line", null: false, index: false
|
50
|
+
t.string "key", null: false
|
51
|
+
t.string "value", null: false
|
52
|
+
t.timestamps null: false
|
63
53
|
end
|
64
54
|
|
65
|
-
add_index "double_entry_line_metadata", ["line_id", "key", "value"], :
|
55
|
+
add_index "double_entry_line_metadata", ["line_id", "key", "value"], name: "lines_meta_line_id_key_value_idx"
|
56
|
+
<%- end -%>
|
66
57
|
end
|
67
58
|
|
68
59
|
def self.down
|
69
|
-
drop_table "double_entry_line_metadata"
|
60
|
+
drop_table "double_entry_line_metadata" if table_exists?("double_entry_line_metadata")
|
70
61
|
drop_table "double_entry_line_checks"
|
71
|
-
drop_table "double_entry_line_aggregates"
|
72
62
|
drop_table "double_entry_lines"
|
73
63
|
drop_table "double_entry_account_balances"
|
74
64
|
end
|
metadata
CHANGED
@@ -1,37 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: double_entry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Keith Pitt
|
9
|
-
- Martin Jagusch
|
10
|
-
- Martin Spickermann
|
11
|
-
- Mark Turnley
|
12
|
-
- Orien Madgwick
|
13
|
-
- Pete Yandall
|
14
|
-
- Stephanie Staub
|
15
|
-
- Giancarlo Salamanca
|
7
|
+
- Envato
|
16
8
|
autorequire:
|
17
9
|
bindir: bin
|
18
10
|
cert_chain: []
|
19
|
-
date:
|
11
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
20
12
|
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
name: money
|
23
|
-
requirement: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: 6.0.0
|
28
|
-
type: :runtime
|
29
|
-
prerelease: false
|
30
|
-
version_requirements: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: 6.0.0
|
35
13
|
- !ruby/object:Gem::Dependency
|
36
14
|
name: activerecord
|
37
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,33 +39,33 @@ dependencies:
|
|
61
39
|
- !ruby/object:Gem::Version
|
62
40
|
version: 3.2.0
|
63
41
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
42
|
+
name: money
|
65
43
|
requirement: !ruby/object:Gem::Requirement
|
66
44
|
requirements:
|
67
45
|
- - ">="
|
68
46
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
47
|
+
version: 6.0.0
|
70
48
|
type: :runtime
|
71
49
|
prerelease: false
|
72
50
|
version_requirements: !ruby/object:Gem::Requirement
|
73
51
|
requirements:
|
74
52
|
- - ">="
|
75
53
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
54
|
+
version: 6.0.0
|
77
55
|
- !ruby/object:Gem::Dependency
|
78
|
-
name:
|
56
|
+
name: railties
|
79
57
|
requirement: !ruby/object:Gem::Requirement
|
80
58
|
requirements:
|
81
59
|
- - ">="
|
82
60
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
84
|
-
type: :
|
61
|
+
version: 3.2.0
|
62
|
+
type: :runtime
|
85
63
|
prerelease: false
|
86
64
|
version_requirements: !ruby/object:Gem::Requirement
|
87
65
|
requirements:
|
88
66
|
- - ">="
|
89
67
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
68
|
+
version: 3.2.0
|
91
69
|
- !ruby/object:Gem::Dependency
|
92
70
|
name: mysql2
|
93
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,35 +95,7 @@ dependencies:
|
|
117
95
|
- !ruby/object:Gem::Version
|
118
96
|
version: '0'
|
119
97
|
- !ruby/object:Gem::Dependency
|
120
|
-
name:
|
121
|
-
requirement: !ruby/object:Gem::Requirement
|
122
|
-
requirements:
|
123
|
-
- - ">="
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
126
|
-
type: :development
|
127
|
-
prerelease: false
|
128
|
-
version_requirements: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - ">="
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '0'
|
133
|
-
- !ruby/object:Gem::Dependency
|
134
|
-
name: rspec
|
135
|
-
requirement: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - ">="
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '0'
|
140
|
-
type: :development
|
141
|
-
prerelease: false
|
142
|
-
version_requirements: !ruby/object:Gem::Requirement
|
143
|
-
requirements:
|
144
|
-
- - ">="
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
version: '0'
|
147
|
-
- !ruby/object:Gem::Dependency
|
148
|
-
name: rspec-its
|
98
|
+
name: rake
|
149
99
|
requirement: !ruby/object:Gem::Requirement
|
150
100
|
requirements:
|
151
101
|
- - ">="
|
@@ -159,7 +109,7 @@ dependencies:
|
|
159
109
|
- !ruby/object:Gem::Version
|
160
110
|
version: '0'
|
161
111
|
- !ruby/object:Gem::Dependency
|
162
|
-
name:
|
112
|
+
name: sqlite3
|
163
113
|
requirement: !ruby/object:Gem::Requirement
|
164
114
|
requirements:
|
165
115
|
- - ">="
|
@@ -187,63 +137,7 @@ dependencies:
|
|
187
137
|
- !ruby/object:Gem::Version
|
188
138
|
version: '0'
|
189
139
|
- !ruby/object:Gem::Dependency
|
190
|
-
name:
|
191
|
-
requirement: !ruby/object:Gem::Requirement
|
192
|
-
requirements:
|
193
|
-
- - ">="
|
194
|
-
- !ruby/object:Gem::Version
|
195
|
-
version: '0'
|
196
|
-
type: :development
|
197
|
-
prerelease: false
|
198
|
-
version_requirements: !ruby/object:Gem::Requirement
|
199
|
-
requirements:
|
200
|
-
- - ">="
|
201
|
-
- !ruby/object:Gem::Version
|
202
|
-
version: '0'
|
203
|
-
- !ruby/object:Gem::Dependency
|
204
|
-
name: machinist
|
205
|
-
requirement: !ruby/object:Gem::Requirement
|
206
|
-
requirements:
|
207
|
-
- - ">="
|
208
|
-
- !ruby/object:Gem::Version
|
209
|
-
version: '0'
|
210
|
-
type: :development
|
211
|
-
prerelease: false
|
212
|
-
version_requirements: !ruby/object:Gem::Requirement
|
213
|
-
requirements:
|
214
|
-
- - ">="
|
215
|
-
- !ruby/object:Gem::Version
|
216
|
-
version: '0'
|
217
|
-
- !ruby/object:Gem::Dependency
|
218
|
-
name: timecop
|
219
|
-
requirement: !ruby/object:Gem::Requirement
|
220
|
-
requirements:
|
221
|
-
- - ">="
|
222
|
-
- !ruby/object:Gem::Version
|
223
|
-
version: '0'
|
224
|
-
type: :development
|
225
|
-
prerelease: false
|
226
|
-
version_requirements: !ruby/object:Gem::Requirement
|
227
|
-
requirements:
|
228
|
-
- - ">="
|
229
|
-
- !ruby/object:Gem::Version
|
230
|
-
version: '0'
|
231
|
-
- !ruby/object:Gem::Dependency
|
232
|
-
name: test-unit
|
233
|
-
requirement: !ruby/object:Gem::Requirement
|
234
|
-
requirements:
|
235
|
-
- - ">="
|
236
|
-
- !ruby/object:Gem::Version
|
237
|
-
version: '0'
|
238
|
-
type: :development
|
239
|
-
prerelease: false
|
240
|
-
version_requirements: !ruby/object:Gem::Requirement
|
241
|
-
requirements:
|
242
|
-
- - ">="
|
243
|
-
- !ruby/object:Gem::Version
|
244
|
-
version: '0'
|
245
|
-
- !ruby/object:Gem::Dependency
|
246
|
-
name: pry
|
140
|
+
name: factory_bot
|
247
141
|
requirement: !ruby/object:Gem::Requirement
|
248
142
|
requirements:
|
249
143
|
- - ">="
|
@@ -257,7 +151,7 @@ dependencies:
|
|
257
151
|
- !ruby/object:Gem::Version
|
258
152
|
version: '0'
|
259
153
|
- !ruby/object:Gem::Dependency
|
260
|
-
name:
|
154
|
+
name: generator_spec
|
261
155
|
requirement: !ruby/object:Gem::Requirement
|
262
156
|
requirements:
|
263
157
|
- - ">="
|
@@ -271,7 +165,7 @@ dependencies:
|
|
271
165
|
- !ruby/object:Gem::Version
|
272
166
|
version: '0'
|
273
167
|
- !ruby/object:Gem::Dependency
|
274
|
-
name:
|
168
|
+
name: rspec
|
275
169
|
requirement: !ruby/object:Gem::Requirement
|
276
170
|
requirements:
|
277
171
|
- - ">="
|
@@ -285,7 +179,7 @@ dependencies:
|
|
285
179
|
- !ruby/object:Gem::Version
|
286
180
|
version: '0'
|
287
181
|
- !ruby/object:Gem::Dependency
|
288
|
-
name:
|
182
|
+
name: rspec-its
|
289
183
|
requirement: !ruby/object:Gem::Requirement
|
290
184
|
requirements:
|
291
185
|
- - ">="
|
@@ -299,7 +193,7 @@ dependencies:
|
|
299
193
|
- !ruby/object:Gem::Version
|
300
194
|
version: '0'
|
301
195
|
- !ruby/object:Gem::Dependency
|
302
|
-
name:
|
196
|
+
name: ruby-prof
|
303
197
|
requirement: !ruby/object:Gem::Requirement
|
304
198
|
requirements:
|
305
199
|
- - ">="
|
@@ -313,7 +207,7 @@ dependencies:
|
|
313
207
|
- !ruby/object:Gem::Version
|
314
208
|
version: '0'
|
315
209
|
- !ruby/object:Gem::Dependency
|
316
|
-
name:
|
210
|
+
name: timecop
|
317
211
|
requirement: !ruby/object:Gem::Requirement
|
318
212
|
requirements:
|
319
213
|
- - ">="
|
@@ -328,27 +222,14 @@ dependencies:
|
|
328
222
|
version: '0'
|
329
223
|
description:
|
330
224
|
email:
|
331
|
-
-
|
332
|
-
- me@keithpitt.com
|
333
|
-
- _@mj.io
|
334
|
-
- spickemann@gmail.com
|
335
|
-
- mark@envato.com
|
336
|
-
- _@orien.io
|
337
|
-
- pete@envato.com
|
338
|
-
- staub.steph@gmail.com
|
339
|
-
- giancarlo@salamanca.net.au
|
225
|
+
- rubygems@envato.com
|
340
226
|
executables: []
|
341
227
|
extensions: []
|
342
228
|
extra_rdoc_files: []
|
343
229
|
files:
|
344
|
-
-
|
345
|
-
- ".rspec"
|
346
|
-
- ".travis.yml"
|
347
|
-
- ".yardopts"
|
348
|
-
- Gemfile
|
230
|
+
- CHANGELOG.md
|
349
231
|
- LICENSE.md
|
350
232
|
- README.md
|
351
|
-
- Rakefile
|
352
233
|
- double_entry.gemspec
|
353
234
|
- lib/active_record/locking_extensions.rb
|
354
235
|
- lib/active_record/locking_extensions/log_subscriber.rb
|
@@ -362,90 +243,23 @@ files:
|
|
362
243
|
- lib/double_entry/line.rb
|
363
244
|
- lib/double_entry/line_metadata.rb
|
364
245
|
- lib/double_entry/locking.rb
|
365
|
-
- lib/double_entry/reporting.rb
|
366
|
-
- lib/double_entry/reporting/aggregate.rb
|
367
|
-
- lib/double_entry/reporting/aggregate_array.rb
|
368
|
-
- lib/double_entry/reporting/day_range.rb
|
369
|
-
- lib/double_entry/reporting/hour_range.rb
|
370
|
-
- lib/double_entry/reporting/line_aggregate.rb
|
371
|
-
- lib/double_entry/reporting/line_aggregate_filter.rb
|
372
|
-
- lib/double_entry/reporting/month_range.rb
|
373
|
-
- lib/double_entry/reporting/time_range.rb
|
374
|
-
- lib/double_entry/reporting/time_range_array.rb
|
375
|
-
- lib/double_entry/reporting/week_range.rb
|
376
|
-
- lib/double_entry/reporting/year_range.rb
|
377
246
|
- lib/double_entry/transfer.rb
|
378
247
|
- lib/double_entry/validation.rb
|
248
|
+
- lib/double_entry/validation/account_fixer.rb
|
379
249
|
- lib/double_entry/validation/line_check.rb
|
380
250
|
- lib/double_entry/version.rb
|
381
251
|
- lib/generators/double_entry/install/install_generator.rb
|
252
|
+
- lib/generators/double_entry/install/templates/initializer.rb
|
382
253
|
- lib/generators/double_entry/install/templates/migration.rb
|
383
|
-
- script/jack_hammer
|
384
|
-
- script/setup.sh
|
385
|
-
- spec/active_record/locking_extensions_spec.rb
|
386
|
-
- spec/double_entry/account_balance_spec.rb
|
387
|
-
- spec/double_entry/account_spec.rb
|
388
|
-
- spec/double_entry/balance_calculator_spec.rb
|
389
|
-
- spec/double_entry/configuration_spec.rb
|
390
|
-
- spec/double_entry/line_spec.rb
|
391
|
-
- spec/double_entry/locking_spec.rb
|
392
|
-
- spec/double_entry/performance/double_entry_performance_spec.rb
|
393
|
-
- spec/double_entry/performance/reporting/aggregate_performance_spec.rb
|
394
|
-
- spec/double_entry/reporting/aggregate_array_spec.rb
|
395
|
-
- spec/double_entry/reporting/aggregate_spec.rb
|
396
|
-
- spec/double_entry/reporting/line_aggregate_filter_spec.rb
|
397
|
-
- spec/double_entry/reporting/line_aggregate_spec.rb
|
398
|
-
- spec/double_entry/reporting/month_range_spec.rb
|
399
|
-
- spec/double_entry/reporting/time_range_array_spec.rb
|
400
|
-
- spec/double_entry/reporting/time_range_spec.rb
|
401
|
-
- spec/double_entry/reporting/week_range_spec.rb
|
402
|
-
- spec/double_entry/reporting_spec.rb
|
403
|
-
- spec/double_entry/transfer_spec.rb
|
404
|
-
- spec/double_entry/validation/line_check_spec.rb
|
405
|
-
- spec/double_entry_spec.rb
|
406
|
-
- spec/generators/double_entry/install/install_generator_spec.rb
|
407
|
-
- spec/spec_helper.rb
|
408
|
-
- spec/support/accounts.rb
|
409
|
-
- spec/support/blueprints.rb
|
410
|
-
- spec/support/database.example.yml
|
411
|
-
- spec/support/database.travis.yml
|
412
|
-
- spec/support/double_entry_spec_helper.rb
|
413
|
-
- spec/support/gemfiles/Gemfile.rails-3.2.x
|
414
|
-
- spec/support/gemfiles/Gemfile.rails-4.1.x
|
415
|
-
- spec/support/gemfiles/Gemfile.rails-4.2.x
|
416
|
-
- spec/support/gemfiles/Gemfile.rails-5.0.x
|
417
|
-
- spec/support/performance_helper.rb
|
418
|
-
- spec/support/reporting_configuration.rb
|
419
|
-
- spec/support/schema.rb
|
420
254
|
homepage: https://github.com/envato/double_entry
|
421
|
-
licenses:
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
class CreateDoubleEntryLineMetadata < ActiveRecord::Migration
|
430
|
-
def self.up
|
431
|
-
create_table "#{DoubleEntry.table_name_prefix}line_metadata", :force => true do |t|
|
432
|
-
t.integer "line_id", :null => false
|
433
|
-
t.string "key", :limit => 48, :null => false
|
434
|
-
t.string "value", :limit => 64, :null => false
|
435
|
-
t.timestamps :null => false
|
436
|
-
end
|
437
|
-
|
438
|
-
add_index "#{DoubleEntry.table_name_prefix}line_metadata",
|
439
|
-
["line_id", "key", "value"],
|
440
|
-
:name => "lines_meta_line_id_key_value_idx"
|
441
|
-
end
|
442
|
-
|
443
|
-
def self.down
|
444
|
-
drop_table "#{DoubleEntry.table_name_prefix}line_metadata"
|
445
|
-
end
|
446
|
-
end
|
447
|
-
|
448
|
-
Please ensure that you update your database accordingly.
|
255
|
+
licenses:
|
256
|
+
- MIT
|
257
|
+
metadata:
|
258
|
+
bug_tracker_uri: https://github.com/envato/double_entry/issues
|
259
|
+
changelog_uri: https://github.com/envato/double_entry/blob/v2.0.0.beta5/CHANGELOG.md
|
260
|
+
documentation_uri: https://www.rubydoc.info/gems/double_entry/2.0.0.beta5
|
261
|
+
source_code_uri: https://github.com/envato/double_entry/tree/v2.0.0.beta5
|
262
|
+
post_install_message:
|
449
263
|
rdoc_options: []
|
450
264
|
require_paths:
|
451
265
|
- lib
|
@@ -453,51 +267,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
453
267
|
requirements:
|
454
268
|
- - ">="
|
455
269
|
- !ruby/object:Gem::Version
|
456
|
-
version:
|
270
|
+
version: 2.3.0
|
457
271
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
458
272
|
requirements:
|
459
|
-
- - "
|
273
|
+
- - ">"
|
460
274
|
- !ruby/object:Gem::Version
|
461
|
-
version:
|
275
|
+
version: 1.3.1
|
462
276
|
requirements: []
|
463
277
|
rubyforge_project:
|
464
|
-
rubygems_version: 2.
|
278
|
+
rubygems_version: 2.7.3
|
465
279
|
signing_key:
|
466
280
|
specification_version: 4
|
467
281
|
summary: Tools to build your double entry financial ledger
|
468
|
-
test_files:
|
469
|
-
- spec/active_record/locking_extensions_spec.rb
|
470
|
-
- spec/double_entry/account_balance_spec.rb
|
471
|
-
- spec/double_entry/account_spec.rb
|
472
|
-
- spec/double_entry/balance_calculator_spec.rb
|
473
|
-
- spec/double_entry/configuration_spec.rb
|
474
|
-
- spec/double_entry/line_spec.rb
|
475
|
-
- spec/double_entry/locking_spec.rb
|
476
|
-
- spec/double_entry/performance/double_entry_performance_spec.rb
|
477
|
-
- spec/double_entry/performance/reporting/aggregate_performance_spec.rb
|
478
|
-
- spec/double_entry/reporting/aggregate_array_spec.rb
|
479
|
-
- spec/double_entry/reporting/aggregate_spec.rb
|
480
|
-
- spec/double_entry/reporting/line_aggregate_filter_spec.rb
|
481
|
-
- spec/double_entry/reporting/line_aggregate_spec.rb
|
482
|
-
- spec/double_entry/reporting/month_range_spec.rb
|
483
|
-
- spec/double_entry/reporting/time_range_array_spec.rb
|
484
|
-
- spec/double_entry/reporting/time_range_spec.rb
|
485
|
-
- spec/double_entry/reporting/week_range_spec.rb
|
486
|
-
- spec/double_entry/reporting_spec.rb
|
487
|
-
- spec/double_entry/transfer_spec.rb
|
488
|
-
- spec/double_entry/validation/line_check_spec.rb
|
489
|
-
- spec/double_entry_spec.rb
|
490
|
-
- spec/generators/double_entry/install/install_generator_spec.rb
|
491
|
-
- spec/spec_helper.rb
|
492
|
-
- spec/support/accounts.rb
|
493
|
-
- spec/support/blueprints.rb
|
494
|
-
- spec/support/database.example.yml
|
495
|
-
- spec/support/database.travis.yml
|
496
|
-
- spec/support/double_entry_spec_helper.rb
|
497
|
-
- spec/support/gemfiles/Gemfile.rails-3.2.x
|
498
|
-
- spec/support/gemfiles/Gemfile.rails-4.1.x
|
499
|
-
- spec/support/gemfiles/Gemfile.rails-4.2.x
|
500
|
-
- spec/support/gemfiles/Gemfile.rails-5.0.x
|
501
|
-
- spec/support/performance_helper.rb
|
502
|
-
- spec/support/reporting_configuration.rb
|
503
|
-
- spec/support/schema.rb
|
282
|
+
test_files: []
|