acts_as_account 3.1.0 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b7bc13b86109af52ad3c4ea1e49d3388e6f6bd27
4
- data.tar.gz: 3981321a1ae869e72270881953704e7bc4a8b4e6
2
+ SHA256:
3
+ metadata.gz: de4d90bc7ede8a221ad6b6c75a2e2f011b3e5d386928a691b474062e176d8e4d
4
+ data.tar.gz: a398469051b8d3f8999736de15df861c523960d00bf0173596d26660259d7cda
5
5
  SHA512:
6
- metadata.gz: 91489dd37949d4288748296de2d67d972c78d38a2bcdb19affb789d7f10ddc9d2b151f8b45a21424644aec7cc62da45a04c56ce9d3f4270f864298dbe08099ab
7
- data.tar.gz: 34a8d296b69f07de19701c66f3bf1ba68e6c905e0e52cc26d41fb857ce14d0f1b41128d80c266965cc82a80f0b235819839910098811903aae12fac2082ce10d
6
+ metadata.gz: 15501c287164b0968fe841e9bb06c1534366a295287428c039ac9539d8e8a9b1a5a7321654d801a53f6b1d2420bf9a6d56d2dc559cebbcc64387fad6442a7183
7
+ data.tar.gz: 89c0ad8c2ba52c551fa6069bff11e2192e00f572a7d477f20b4b02028f4eb64146fc2dd08fc51e52150f6e6e305e2615446506ae0e9bd385e33d30a1d5ec6166
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ .*.sw[pon]
2
+ .AppleDouble
3
+ .DS_Store
4
+ .byebug_history
5
+ .rvmrc
6
+ Gemfile.lock
7
+ coverage
8
+ pkg
9
+ tags
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ rvm:
2
+ - 2.3.3
3
+ - 2.6.3
4
+ sudo: false
5
+ script: rake
data/Gemfile CHANGED
@@ -1,14 +1,5 @@
1
- source "http://rubygems.org"
1
+ # vim: set filetype=ruby et sw=2 ts=2:
2
2
 
3
- group :development do
4
- gem 'rspec'
5
- gem 'jeweler'
6
- gem 'cucumber'
7
- gem 'mysql'
8
- end
3
+ source 'https://rubygems.org'
9
4
 
10
- group :default do
11
- gem 'activerecord', '~> 4.1.0'
12
- gem 'actionpack' , '~> 4.1.0'
13
- gem 'database_cleaner'
14
- end
5
+ gemspec
data/LICENSE CHANGED
File without changes
data/README.rdoc CHANGED
@@ -1,5 +1,7 @@
1
1
  = acts_as_account
2
2
 
3
+ {<img src="https://travis-ci.org/betterplace/acts_as_account.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/betterplace/acts_as_account]
4
+
3
5
  == Theory
4
6
 
5
7
  ActsAsAccount implements a "Double Entry Accounting" system for your
data/Rakefile CHANGED
@@ -1,40 +1,54 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- Bundler.require(:default, :development)
6
- rescue Bundler::BundlerError => e
7
- $stderr.puts e.message
8
- $stderr.puts "Run `bundle install` to install missing gems"
9
- exit e.status_code
1
+ # vim: set filetype=ruby et sw=2 ts=2:
2
+
3
+ require 'gem_hadar'
4
+
5
+ GemHadar do
6
+ name 'acts_as_account'
7
+ author [ "Thies C. Arntzen, Norman Timmler, Matthias Frick, Phillip Oertel" ]
8
+ email 'developers@betterplace.org'
9
+ homepage "http://github.com/betterplace/acts_as_account"
10
+ summary 'acts_as_account implements double entry accounting for Rails models'
11
+ description 'acts_as_account implements double entry accounting for Rails models. Your models get accounts and you can do consistent transactions between them. Since the documentation is sparse, see the transfer.feature for usage examples.'
12
+ test_dir 'tests'
13
+ ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', 'coverage', '.rvmrc',
14
+ '.AppleDouble', 'tags', '.byebug_history', '.DS_Store'
15
+ readme 'README.rdoc'
16
+ title "#{name.camelize} -- More Math in Ruby"
17
+ licenses << 'Apache-2.0'
18
+
19
+ dependency 'activerecord', '>= 4.1', '<7'
20
+ dependency 'actionpack' , '>= 4.1', '<7'
21
+ development_dependency 'cucumber', '~> 1.3'
22
+ development_dependency 'mysql2'
23
+ development_dependency 'rspec', '~> 3.1'
24
+ development_dependency 'simplecov'
25
+ development_dependency 'complex_config'
26
+ development_dependency 'database_cleaner', '~> 1.3'
10
27
  end
11
- require 'rake'
12
28
 
13
- begin
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- gem.name = "acts_as_account"
17
- gem.summary = %Q{acts_as_account implements double entry accounting for Rails models}
18
- gem.description = %Q{acts_as_account implements double entry accounting for Rails models. Your models get accounts and you can do consistent transactions between them. Since the documentation is sparse, see the transfer.feature for usage examples.}
19
- gem.email = "developers@betterplace.org"
20
- gem.homepage = "http://github.com/betterplace/acts_as_account"
21
- gem.authors = ["Thies C. Arntzen, Norman Timmler, Matthias Frick, Phillip Oertel"]
22
- end
23
- Jeweler::GemcutterTasks.new
24
- rescue LoadError
25
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
29
+ def connect_database
30
+ require 'active_record'
31
+ require 'complex_config'
32
+ config = ComplexConfig::Provider.config 'features/db/database.yml'
33
+ connection_config = config.acts_as_account.to_h
34
+ connection_config.delete(:database)
35
+ ActiveRecord::Base.establish_connection(connection_config).connection
26
36
  end
27
37
 
28
38
  namespace :features do
29
39
  desc "create test database out of db/schema.rb"
30
40
  task :create_database do
31
- require 'rubygems'
32
- require 'active_record'
33
- access_data = YAML.load_file(File.dirname(__FILE__) + '/db/database.yml')['acts_as_account']
34
- conn = ActiveRecord::Base.establish_connection(Hash[access_data.select { |k, v| k != 'database'}]).connection
41
+ conn = connect_database
35
42
  conn.execute('DROP DATABASE IF EXISTS acts_as_account')
36
43
  conn.execute('CREATE DATABASE acts_as_account')
37
44
  conn.execute('USE acts_as_account')
38
- load(File.dirname(__FILE__) + '/db/schema.rb')
45
+ load(File.dirname(__FILE__) + '/features/db/schema.rb')
39
46
  end
40
47
  end
48
+
49
+ desc "Run features"
50
+ task :features => :'features:create_database' do
51
+ ruby '-S', 'cucumber'
52
+ end
53
+
54
+ task :test => :features
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.0
1
+ 3.2.2
@@ -1,89 +1,47 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
5
- # stub: acts_as_account 3.1.0 ruby lib
2
+ # stub: acts_as_account 3.2.2 ruby lib
6
3
 
7
4
  Gem::Specification.new do |s|
8
- s.name = "acts_as_account"
9
- s.version = "3.1.0"
5
+ s.name = "acts_as_account".freeze
6
+ s.version = "3.2.2"
10
7
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Thies C. Arntzen, Norman Timmler, Matthias Frick, Phillip Oertel"]
14
- s.date = "2014-08-19"
15
- s.description = "acts_as_account implements double entry accounting for Rails models. Your models get accounts and you can do consistent transactions between them. Since the documentation is sparse, see the transfer.feature for usage examples."
16
- s.email = "developers@betterplace.org"
17
- s.extra_rdoc_files = [
18
- "LICENSE",
19
- "README.rdoc"
20
- ]
21
- s.files = [
22
- ".ruby-gemset",
23
- ".ruby-version",
24
- ".specification",
25
- "CHANGELOG.md",
26
- "Gemfile",
27
- "Gemfile.lock",
28
- "LICENSE",
29
- "README.rdoc",
30
- "Rakefile",
31
- "VERSION",
32
- "acts_as_account.gemspec",
33
- "cucumber.yml",
34
- "db/database.yml",
35
- "db/schema.rb",
36
- "features/account/account_creation.feature",
37
- "features/step_definitions/account_steps.rb",
38
- "features/support/abstract_user.rb",
39
- "features/support/cheque.rb",
40
- "features/support/env.rb",
41
- "features/support/inheriting_user.rb",
42
- "features/support/user.rb",
43
- "features/transfer/journal_creation.feature",
44
- "features/transfer/transfer.feature",
45
- "init.rb",
46
- "lib/acts_as_account.rb",
47
- "lib/acts_as_account/account.rb",
48
- "lib/acts_as_account/active_record_extensions.rb",
49
- "lib/acts_as_account/global_account.rb",
50
- "lib/acts_as_account/journal.rb",
51
- "lib/acts_as_account/manually_created_account.rb",
52
- "lib/acts_as_account/posting.rb",
53
- "lib/acts_as_account/transfer.rb"
54
- ]
55
- s.homepage = "http://github.com/betterplace/acts_as_account"
56
- s.rubygems_version = "2.2.2"
57
- s.summary = "acts_as_account implements double entry accounting for Rails models"
8
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib".freeze]
10
+ s.authors = ["Thies C. Arntzen, Norman Timmler, Matthias Frick, Phillip Oertel".freeze]
11
+ s.date = "2021-02-22"
12
+ s.description = "acts_as_account implements double entry accounting for Rails models. Your models get accounts and you can do consistent transactions between them. Since the documentation is sparse, see the transfer.feature for usage examples.".freeze
13
+ s.email = "developers@betterplace.org".freeze
14
+ s.extra_rdoc_files = ["README.rdoc".freeze, "lib/acts_as_account.rb".freeze, "lib/acts_as_account/account.rb".freeze, "lib/acts_as_account/active_record_extensions.rb".freeze, "lib/acts_as_account/global_account.rb".freeze, "lib/acts_as_account/journal.rb".freeze, "lib/acts_as_account/manually_created_account.rb".freeze, "lib/acts_as_account/posting.rb".freeze, "lib/acts_as_account/rails.rb".freeze, "lib/acts_as_account/transfer.rb".freeze, "lib/acts_as_account/version.rb".freeze]
15
+ s.files = [".gitignore".freeze, ".travis.yml".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.rdoc".freeze, "Rakefile".freeze, "VERSION".freeze, "acts_as_account.gemspec".freeze, "cucumber.yml".freeze, "features/account/account_creation.feature".freeze, "features/db/database.yml".freeze, "features/db/schema.rb".freeze, "features/step_definitions/account_steps.rb".freeze, "features/support/abstract_user.rb".freeze, "features/support/cheque.rb".freeze, "features/support/env.rb".freeze, "features/support/inheriting_user.rb".freeze, "features/support/user.rb".freeze, "features/transfer/journal_creation.feature".freeze, "features/transfer/transfer.feature".freeze, "init.rb".freeze, "lib/acts_as_account.rb".freeze, "lib/acts_as_account/account.rb".freeze, "lib/acts_as_account/active_record_extensions.rb".freeze, "lib/acts_as_account/global_account.rb".freeze, "lib/acts_as_account/journal.rb".freeze, "lib/acts_as_account/manually_created_account.rb".freeze, "lib/acts_as_account/posting.rb".freeze, "lib/acts_as_account/rails.rb".freeze, "lib/acts_as_account/transfer.rb".freeze, "lib/acts_as_account/version.rb".freeze]
16
+ s.homepage = "http://github.com/betterplace/acts_as_account".freeze
17
+ s.licenses = ["Apache-2.0".freeze]
18
+ s.rdoc_options = ["--title".freeze, "ActsAsAccount -- More Math in Ruby".freeze, "--main".freeze, "README.rdoc".freeze]
19
+ s.rubygems_version = "3.2.8".freeze
20
+ s.summary = "acts_as_account implements double entry accounting for Rails models".freeze
58
21
 
59
22
  if s.respond_to? :specification_version then
60
23
  s.specification_version = 4
24
+ end
61
25
 
62
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
63
- s.add_runtime_dependency(%q<activerecord>, ["~> 4.1.0"])
64
- s.add_runtime_dependency(%q<actionpack>, ["~> 4.1.0"])
65
- s.add_runtime_dependency(%q<database_cleaner>, [">= 0"])
66
- s.add_development_dependency(%q<rspec>, [">= 0"])
67
- s.add_development_dependency(%q<jeweler>, [">= 0"])
68
- s.add_development_dependency(%q<cucumber>, [">= 0"])
69
- s.add_development_dependency(%q<mysql>, [">= 0"])
70
- else
71
- s.add_dependency(%q<activerecord>, ["~> 4.1.0"])
72
- s.add_dependency(%q<actionpack>, ["~> 4.1.0"])
73
- s.add_dependency(%q<database_cleaner>, [">= 0"])
74
- s.add_dependency(%q<rspec>, [">= 0"])
75
- s.add_dependency(%q<jeweler>, [">= 0"])
76
- s.add_dependency(%q<cucumber>, [">= 0"])
77
- s.add_dependency(%q<mysql>, [">= 0"])
78
- end
26
+ if s.respond_to? :add_runtime_dependency then
27
+ s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
28
+ s.add_development_dependency(%q<cucumber>.freeze, ["~> 1.3"])
29
+ s.add_development_dependency(%q<mysql2>.freeze, [">= 0"])
30
+ s.add_development_dependency(%q<rspec>.freeze, ["~> 3.1"])
31
+ s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
32
+ s.add_development_dependency(%q<complex_config>.freeze, [">= 0"])
33
+ s.add_development_dependency(%q<database_cleaner>.freeze, ["~> 1.3"])
34
+ s.add_runtime_dependency(%q<activerecord>.freeze, [">= 4.1", "< 7"])
35
+ s.add_runtime_dependency(%q<actionpack>.freeze, [">= 4.1", "< 7"])
79
36
  else
80
- s.add_dependency(%q<activerecord>, ["~> 4.1.0"])
81
- s.add_dependency(%q<actionpack>, ["~> 4.1.0"])
82
- s.add_dependency(%q<database_cleaner>, [">= 0"])
83
- s.add_dependency(%q<rspec>, [">= 0"])
84
- s.add_dependency(%q<jeweler>, [">= 0"])
85
- s.add_dependency(%q<cucumber>, [">= 0"])
86
- s.add_dependency(%q<mysql>, [">= 0"])
37
+ s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
38
+ s.add_dependency(%q<cucumber>.freeze, ["~> 1.3"])
39
+ s.add_dependency(%q<mysql2>.freeze, [">= 0"])
40
+ s.add_dependency(%q<rspec>.freeze, ["~> 3.1"])
41
+ s.add_dependency(%q<simplecov>.freeze, [">= 0"])
42
+ s.add_dependency(%q<complex_config>.freeze, [">= 0"])
43
+ s.add_dependency(%q<database_cleaner>.freeze, ["~> 1.3"])
44
+ s.add_dependency(%q<activerecord>.freeze, [">= 4.1", "< 7"])
45
+ s.add_dependency(%q<actionpack>.freeze, [">= 4.1", "< 7"])
87
46
  end
88
47
  end
89
-
data/cucumber.yml CHANGED
File without changes
File without changes
@@ -1,7 +1,6 @@
1
1
  acts_as_account:
2
- adapter: mysql
2
+ adapter: mysql2
3
3
  encoding: utf8
4
4
  database: acts_as_account
5
5
  username: root
6
- password:
7
6
  host: localhost
@@ -0,0 +1,70 @@
1
+ ActiveRecord::Schema.define(version: 1) do
2
+ if ENV['DROP_FK']
3
+ execute "ALTER TABLE acts_as_account_postings DROP FOREIGN KEY account_id"
4
+ execute "ALTER TABLE acts_as_account_postings DROP FOREIGN KEY other_account_id"
5
+ execute "ALTER TABLE acts_as_account_postings DROP FOREIGN KEY journal_id"
6
+ end
7
+
8
+ create_table "acts_as_account_accounts", force: true do |t|
9
+ t.belongs_to "holder", null: false
10
+ t.string "holder_type", null: false
11
+ t.string "name", null: false
12
+
13
+ t.integer "balance", default: 0
14
+ t.integer "postings_count", default: 0
15
+ t.datetime "last_valuta"
16
+
17
+ t.datetime "created_at"
18
+ t.datetime "updated_at"
19
+ end
20
+ add_index "acts_as_account_accounts", ["holder_id", "holder_type", "name"], name: 'account_unique', unique: true
21
+
22
+ create_table "acts_as_account_journals", force: true do |t|
23
+ t.datetime "created_at"
24
+ t.datetime "updated_at"
25
+ end
26
+
27
+ create_table "acts_as_account_postings", force: true do |t|
28
+ t.belongs_to "account", null: false, index: true
29
+ t.belongs_to "other_account", null: false
30
+ t.belongs_to "journal", null: false, index: true
31
+ t.integer "amount", null: false
32
+
33
+ t.belongs_to "reference"
34
+ t.string "reference_type"
35
+
36
+ t.datetime "valuta"
37
+
38
+ t.datetime "created_at"
39
+ t.datetime "updated_at"
40
+ end
41
+ add_index "acts_as_account_postings", ["reference_type", "reference_id"], name: "reference"
42
+ add_index "acts_as_account_postings", ["valuta", "id"], name: "sort_key"
43
+
44
+ execute "ALTER TABLE acts_as_account_postings ADD CONSTRAINT account_id FOREIGN KEY (account_id) REFERENCES acts_as_account_accounts (id)"
45
+ execute "ALTER TABLE acts_as_account_postings ADD CONSTRAINT other_account_id FOREIGN KEY (other_account_id) REFERENCES acts_as_account_accounts (id)"
46
+ execute "ALTER TABLE acts_as_account_postings ADD CONSTRAINT journal_id FOREIGN KEY (journal_id) REFERENCES acts_as_account_journals (id)"
47
+
48
+ create_table "acts_as_account_global_accounts", force: true do |t|
49
+ t.string "name", null: false
50
+ end
51
+
52
+ create_table "users", force: true do |t|
53
+ t.string "name", null: false
54
+ t.datetime "created_at"
55
+ t.datetime "updated_at"
56
+ end
57
+
58
+ create_table "abstract_users", force: true do |t|
59
+ t.string "name", null: false
60
+ t.string "type", null: false
61
+ t.datetime "created_at"
62
+ t.datetime "updated_at"
63
+ end
64
+
65
+ create_table "cheques", force: true do |t|
66
+ t.string "number"
67
+ t.datetime "created_at"
68
+ t.datetime "updated_at"
69
+ end
70
+ end
@@ -2,6 +2,11 @@
2
2
 
3
3
  include ActsAsAccount
4
4
 
5
+ require 'rspec'
6
+ RSpec.configure do |config|
7
+ config.expect_with(:rspec) { |c| c.syntax = :should }
8
+ end
9
+
5
10
  def german_date_time_to_local(datestring, timestring)
6
11
  Time.local(*(datestring.split(".").reverse + timestring.split(":")).map(&:to_i))
7
12
  end
File without changes
@@ -1,5 +1,14 @@
1
- require File.dirname(__FILE__) + '/../../lib/acts_as_account'
2
- ActiveRecord::Base.establish_connection(YAML.load_file(File.dirname(__FILE__) + '/../../db/database.yml')['acts_as_account'])
1
+ if ENV['START_SIMPLECOV'].to_i == 1
2
+ require 'simplecov'
3
+ SimpleCov.start do
4
+ add_filter 'features'
5
+ end
6
+ end
7
+
8
+ require 'acts_as_account'
9
+ require 'complex_config'
10
+ config =ComplexConfig::Provider.config File.dirname(__FILE__) + '/../db/database.yml'
11
+ ActiveRecord::Base.establish_connection(config.acts_as_account.to_h)
3
12
 
4
13
  require 'database_cleaner'
5
14
  require 'database_cleaner/cucumber'
File without changes
File without changes
File without changes
@@ -1,17 +1,15 @@
1
1
  require 'active_record'
2
2
  require 'action_controller'
3
3
 
4
- $: << File.expand_path(File.dirname(__FILE__))
4
+ module ActsAsAccount
5
+ end
5
6
 
7
+ require 'acts_as_account/version'
6
8
  require 'acts_as_account/transfer'
7
9
  require 'acts_as_account/account'
8
10
  require 'acts_as_account/journal'
9
11
  require 'acts_as_account/posting'
10
12
  require 'acts_as_account/active_record_extensions'
11
-
12
- ActiveRecord::Base.class_eval do
13
- include ActsAsAccount::ActiveRecordExtension
14
- end
15
-
13
+ require 'acts_as_account/rails'
16
14
  require 'acts_as_account/global_account'
17
- require 'acts_as_account/manually_created_account'
15
+ require 'acts_as_account/manually_created_account'
@@ -13,31 +13,13 @@ module ActsAsAccount
13
13
  # validates_presence_of :holder
14
14
 
15
15
  class << self
16
-
17
16
  def recalculate_all_balances
18
- ActsAsAccount::Account.update_all(:balance => 0, :postings_count => 0, :last_valuta => nil)
19
- sql = <<-EOT
20
- SELECT
21
- account_id as id,
22
- count(*) as calculated_postings_count,
23
- sum(amount) as calculated_balance,
24
- max(valuta) as calculated_valuta
25
- FROM
26
- acts_as_account_postings
27
- GROUP BY
28
- account_id
29
- HAVING
30
- calculated_postings_count > 0
31
- EOT
32
-
33
- ActsAsAccount::Account.find_by_sql(sql).each do |account|
34
- account.lock!
35
- account.update_attributes(
36
- :balance => account.calculated_balance,
37
- :postings_count => account.calculated_postings_count,
38
- :last_valuta => account.calculated_valuta)
39
-
40
- puts "account:#{account.id}, balance:#{account.balance}, postings_count:#{account.postings_count}, last_valuta:#{account.last_valuta}"
17
+ find_each do |account|
18
+ account.update_columns(
19
+ balance: account.postings.sum(:amount),
20
+ postings_count: account.postings.count,
21
+ last_valuta: account.postings.maximum(:valuta)
22
+ )
41
23
  end
42
24
  end
43
25
 
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,5 @@
1
+ require 'time'
2
+
1
3
  module ActsAsAccount
2
4
  class Posting < ActiveRecord::Base
3
5
  self.table_name = :acts_as_account_postings
@@ -9,7 +11,13 @@ module ActsAsAccount
9
11
 
10
12
  scope :soll, -> { where('amount >= 0') }
11
13
  scope :haben, -> { where('amount < 0') }
12
- scope :start_date, -> date { where ['DATE(valuta) >= ?', date] }
13
- scope :end_date, -> date { where ['DATE(valuta) <= ?', date] }
14
+ scope :start_date, -> date {
15
+ date = Time.parse(date.to_s).utc.to_s(:db)
16
+ where(['valuta >= ?', date])
17
+ }
18
+ scope :end_date, -> date {
19
+ date = Time.parse(date.to_s).utc.to_s(:db)
20
+ where(['valuta <= ?', date])
21
+ }
14
22
  end
15
23
  end
@@ -0,0 +1,3 @@
1
+ ActiveRecord::Base.class_eval do
2
+ include ActsAsAccount::ActiveRecordExtension
3
+ end
File without changes
@@ -0,0 +1,8 @@
1
+ module ActsAsAccount
2
+ # ActsAsAccount version
3
+ VERSION = '3.2.2'
4
+ VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
+ VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
+ VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
7
+ VERSION_BUILD = VERSION_ARRAY[2] # :nodoc:
8
+ end
metadata CHANGED
@@ -1,113 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_account
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thies C. Arntzen, Norman Timmler, Matthias Frick, Phillip Oertel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-19 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: activerecord
14
+ name: gem_hadar
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0
20
- type: :runtime
19
+ version: 1.11.0
20
+ type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.0
26
+ version: 1.11.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: actionpack
28
+ name: cucumber
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.0
34
- type: :runtime
33
+ version: '1.3'
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 4.1.0
40
+ version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: database_cleaner
42
+ name: mysql2
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
- type: :runtime
48
+ type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '3.1'
69
69
  - !ruby/object:Gem::Dependency
70
- name: jeweler
70
+ name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: cucumber
84
+ name: complex_config
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: mysql
98
+ name: database_cleaner
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '1.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '1.3'
111
+ - !ruby/object:Gem::Dependency
112
+ name: activerecord
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '4.1'
118
+ - - "<"
119
+ - !ruby/object:Gem::Version
120
+ version: '7'
121
+ type: :runtime
122
+ prerelease: false
123
+ version_requirements: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '4.1'
128
+ - - "<"
129
+ - !ruby/object:Gem::Version
130
+ version: '7'
131
+ - !ruby/object:Gem::Dependency
132
+ name: actionpack
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '4.1'
138
+ - - "<"
139
+ - !ruby/object:Gem::Version
140
+ version: '7'
141
+ type: :runtime
142
+ prerelease: false
143
+ version_requirements: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '4.1'
148
+ - - "<"
149
+ - !ruby/object:Gem::Version
150
+ version: '7'
111
151
  description: acts_as_account implements double entry accounting for Rails models.
112
152
  Your models get accounts and you can do consistent transactions between them. Since
113
153
  the documentation is sparse, see the transfer.feature for usage examples.
@@ -115,24 +155,31 @@ email: developers@betterplace.org
115
155
  executables: []
116
156
  extensions: []
117
157
  extra_rdoc_files:
118
- - LICENSE
119
158
  - README.rdoc
159
+ - lib/acts_as_account.rb
160
+ - lib/acts_as_account/account.rb
161
+ - lib/acts_as_account/active_record_extensions.rb
162
+ - lib/acts_as_account/global_account.rb
163
+ - lib/acts_as_account/journal.rb
164
+ - lib/acts_as_account/manually_created_account.rb
165
+ - lib/acts_as_account/posting.rb
166
+ - lib/acts_as_account/rails.rb
167
+ - lib/acts_as_account/transfer.rb
168
+ - lib/acts_as_account/version.rb
120
169
  files:
121
- - .ruby-gemset
122
- - .ruby-version
123
- - .specification
170
+ - ".gitignore"
171
+ - ".travis.yml"
124
172
  - CHANGELOG.md
125
173
  - Gemfile
126
- - Gemfile.lock
127
174
  - LICENSE
128
175
  - README.rdoc
129
176
  - Rakefile
130
177
  - VERSION
131
178
  - acts_as_account.gemspec
132
179
  - cucumber.yml
133
- - db/database.yml
134
- - db/schema.rb
135
180
  - features/account/account_creation.feature
181
+ - features/db/database.yml
182
+ - features/db/schema.rb
136
183
  - features/step_definitions/account_steps.rb
137
184
  - features/support/abstract_user.rb
138
185
  - features/support/cheque.rb
@@ -149,28 +196,34 @@ files:
149
196
  - lib/acts_as_account/journal.rb
150
197
  - lib/acts_as_account/manually_created_account.rb
151
198
  - lib/acts_as_account/posting.rb
199
+ - lib/acts_as_account/rails.rb
152
200
  - lib/acts_as_account/transfer.rb
201
+ - lib/acts_as_account/version.rb
153
202
  homepage: http://github.com/betterplace/acts_as_account
154
- licenses: []
203
+ licenses:
204
+ - Apache-2.0
155
205
  metadata: {}
156
- post_install_message:
157
- rdoc_options: []
206
+ post_install_message:
207
+ rdoc_options:
208
+ - "--title"
209
+ - ActsAsAccount -- More Math in Ruby
210
+ - "--main"
211
+ - README.rdoc
158
212
  require_paths:
159
213
  - lib
160
214
  required_ruby_version: !ruby/object:Gem::Requirement
161
215
  requirements:
162
- - - '>='
216
+ - - ">="
163
217
  - !ruby/object:Gem::Version
164
218
  version: '0'
165
219
  required_rubygems_version: !ruby/object:Gem::Requirement
166
220
  requirements:
167
- - - '>='
221
+ - - ">="
168
222
  - !ruby/object:Gem::Version
169
223
  version: '0'
170
224
  requirements: []
171
- rubyforge_project:
172
- rubygems_version: 2.2.2
173
- signing_key:
225
+ rubygems_version: 3.2.8
226
+ signing_key:
174
227
  specification_version: 4
175
228
  summary: acts_as_account implements double entry accounting for Rails models
176
229
  test_files: []
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- acts_as_account
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.0.0
data/.specification DELETED
@@ -1,57 +0,0 @@
1
- --- !ruby/object:Gem::Specification
2
- name: acts_as_account
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- platform: ruby
6
- authors: []
7
-
8
- autorequire:
9
- bindir: bin
10
- cert_chain: []
11
-
12
- date: 2010-03-18 00:00:00 +01:00
13
- default_executable:
14
- dependencies: []
15
-
16
- description:
17
- email:
18
- executables: []
19
-
20
- extensions: []
21
-
22
- extra_rdoc_files: []
23
-
24
- files:
25
- - lib
26
- - lib/acts_as_account
27
- - lib/acts_as_account.rb
28
- has_rdoc: true
29
- homepage:
30
- licenses: []
31
-
32
- post_install_message:
33
- rdoc_options: []
34
-
35
- require_paths:
36
- - lib
37
- required_ruby_version: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: "0"
42
- version:
43
- required_rubygems_version: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: "0"
48
- version:
49
- requirements: []
50
-
51
- rubyforge_project:
52
- rubygems_version: 1.3.5
53
- signing_key:
54
- specification_version: 3
55
- summary:
56
- test_files: []
57
-
data/Gemfile.lock DELETED
@@ -1,108 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- actionpack (4.1.0)
5
- actionview (= 4.1.0)
6
- activesupport (= 4.1.0)
7
- rack (~> 1.5.2)
8
- rack-test (~> 0.6.2)
9
- actionview (4.1.0)
10
- activesupport (= 4.1.0)
11
- builder (~> 3.1)
12
- erubis (~> 2.7.0)
13
- activemodel (4.1.0)
14
- activesupport (= 4.1.0)
15
- builder (~> 3.1)
16
- activerecord (4.1.0)
17
- activemodel (= 4.1.0)
18
- activesupport (= 4.1.0)
19
- arel (~> 5.0.0)
20
- activesupport (4.1.0)
21
- i18n (~> 0.6, >= 0.6.9)
22
- json (~> 1.7, >= 1.7.7)
23
- minitest (~> 5.1)
24
- thread_safe (~> 0.1)
25
- tzinfo (~> 1.1)
26
- addressable (2.3.5)
27
- arel (5.0.1.20140414130214)
28
- builder (3.1.4)
29
- cucumber (1.3.10)
30
- builder (>= 2.1.2)
31
- diff-lcs (>= 1.1.3)
32
- gherkin (~> 2.12)
33
- multi_json (>= 1.7.5, < 2.0)
34
- multi_test (>= 0.0.2)
35
- database_cleaner (1.2.0)
36
- diff-lcs (1.2.5)
37
- erubis (2.7.0)
38
- faraday (0.8.8)
39
- multipart-post (~> 1.2.0)
40
- gherkin (2.12.2)
41
- multi_json (~> 1.3)
42
- git (1.2.6)
43
- github_api (0.10.1)
44
- addressable
45
- faraday (~> 0.8.1)
46
- hashie (>= 1.2)
47
- multi_json (~> 1.4)
48
- nokogiri (~> 1.5.2)
49
- oauth2
50
- hashie (2.0.5)
51
- highline (1.6.20)
52
- httpauth (0.2.0)
53
- i18n (0.6.9)
54
- jeweler (1.8.8)
55
- builder
56
- bundler (~> 1.0)
57
- git (>= 1.2.5)
58
- github_api (= 0.10.1)
59
- highline (>= 1.6.15)
60
- nokogiri (= 1.5.10)
61
- rake
62
- rdoc
63
- json (1.8.1)
64
- jwt (0.1.8)
65
- multi_json (>= 1.5)
66
- minitest (5.3.3)
67
- multi_json (1.8.2)
68
- multi_test (0.0.2)
69
- multi_xml (0.5.5)
70
- multipart-post (1.2.0)
71
- mysql (2.9.1)
72
- nokogiri (1.5.10)
73
- oauth2 (0.9.2)
74
- faraday (~> 0.8)
75
- httpauth (~> 0.2)
76
- jwt (~> 0.1.4)
77
- multi_json (~> 1.0)
78
- multi_xml (~> 0.5)
79
- rack (~> 1.2)
80
- rack (1.5.2)
81
- rack-test (0.6.2)
82
- rack (>= 1.0)
83
- rake (10.1.0)
84
- rdoc (4.0.1)
85
- json (~> 1.4)
86
- rspec (2.14.1)
87
- rspec-core (~> 2.14.0)
88
- rspec-expectations (~> 2.14.0)
89
- rspec-mocks (~> 2.14.0)
90
- rspec-core (2.14.7)
91
- rspec-expectations (2.14.4)
92
- diff-lcs (>= 1.1.3, < 2.0)
93
- rspec-mocks (2.14.4)
94
- thread_safe (0.3.3)
95
- tzinfo (1.1.0)
96
- thread_safe (~> 0.1)
97
-
98
- PLATFORMS
99
- ruby
100
-
101
- DEPENDENCIES
102
- actionpack (~> 4.1.0)
103
- activerecord (~> 4.1.0)
104
- cucumber
105
- database_cleaner
106
- jeweler
107
- mysql
108
- rspec
data/db/schema.rb DELETED
@@ -1,71 +0,0 @@
1
- ActiveRecord::Schema.define(:version => 1) do
2
- if ENV['DROP_FK']
3
- execute "ALTER TABLE acts_as_account_postings DROP FOREIGN KEY account_id"
4
- execute "ALTER TABLE acts_as_account_postings DROP FOREIGN KEY other_account_id"
5
- execute "ALTER TABLE acts_as_account_postings DROP FOREIGN KEY journal_id"
6
- end
7
-
8
- create_table "acts_as_account_accounts", :force => true do |t|
9
- t.integer "holder_id", :null => false
10
- t.string "holder_type", :null => false
11
- t.string "name", :null => false
12
-
13
- t.integer "balance", :default => 0
14
- t.integer "postings_count", :default => 0
15
- t.datetime "last_valuta"
16
-
17
- t.datetime "created_at"
18
- t.datetime "updated_at"
19
- end
20
- add_index "acts_as_account_accounts", ["holder_id", "holder_type", "name"], :name => 'account_unique', :unique => true
21
-
22
- create_table "acts_as_account_journals", :force => true do |t|
23
- t.datetime "created_at"
24
- t.datetime "updated_at"
25
- end
26
-
27
- create_table "acts_as_account_postings", :force => true do |t|
28
- t.integer "account_id", :null => false
29
- t.integer "other_account_id", :null => false
30
- t.integer "journal_id", :null => false
31
- t.integer "amount", :null => false
32
-
33
- t.integer "reference_id"
34
- t.string "reference_type"
35
-
36
- t.datetime "valuta"
37
-
38
- t.datetime "created_at"
39
- t.datetime "updated_at"
40
- end
41
- add_index "acts_as_account_postings", "account_id"
42
- add_index "acts_as_account_postings", "journal_id"
43
- add_index "acts_as_account_postings", ["reference_type", "reference_id"], :name => "reference"
44
- add_index "acts_as_account_postings", ["valuta", "id"], :name => "sort_key"
45
-
46
- execute "ALTER TABLE acts_as_account_postings ADD CONSTRAINT account_id FOREIGN KEY (account_id) REFERENCES acts_as_account_accounts (id)"
47
- execute "ALTER TABLE acts_as_account_postings ADD CONSTRAINT other_account_id FOREIGN KEY (other_account_id) REFERENCES acts_as_account_accounts (id)"
48
- execute "ALTER TABLE acts_as_account_postings ADD CONSTRAINT journal_id FOREIGN KEY (journal_id) REFERENCES acts_as_account_journals (id)"
49
-
50
- create_table "acts_as_account_global_accounts", :force => true do |t|
51
- t.string "name", :null => false
52
- end
53
-
54
- create_table "users", :force => true do |t|
55
- t.string "name", :null => false
56
- t.datetime "created_at"
57
- t.datetime "updated_at"
58
- end
59
-
60
- create_table "abstract_users", :force => true do |t|
61
- t.string "name", :null => false
62
- t.string "type", :null => false
63
- t.datetime "created_at"
64
- t.datetime "updated_at"
65
- end
66
- create_table "cheques", :force => true do |t|
67
- t.string "number"
68
- t.datetime "created_at"
69
- t.datetime "updated_at"
70
- end
71
- end