debitcredit 0.0.2 → 0.0.3

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
2
  SHA1:
3
- metadata.gz: 039a6cb02706fa5832f4a614f4dee115e77edb98
4
- data.tar.gz: 4688c492151e6ba2d8cc33213eec83d6285b6b4f
3
+ metadata.gz: f5c9ca7c15a9a0033ccdf7dc8ba48be7c2235f09
4
+ data.tar.gz: 639c675e7fa7448a3dae30abd464249af7dffafc
5
5
  SHA512:
6
- metadata.gz: ceecb7673d2ef6979b876bc568009ed1eaae62746d13927b149f35fa53deedae7c970835f47eb770d38ac94821eee068cc04b1277e480efb7ac635290ab78d01
7
- data.tar.gz: 81bcdce582dc373dd8dde2dd85c41a9bd25c433c9a2f2f9f800b3545408c142d567f95295c4ac3ab336b753b6fe8823bd2ea586c9bbcd3e04bfd0a69a461ab29
6
+ metadata.gz: 9eabc70957e8da1b80fd373f3b9626af95a56b35f4c9245695c7558ea18d2b9318a1a8a7eb9c4c488573124d83cf32e6d3c4635be4354615a384128d2a98c818
7
+ data.tar.gz: 1fbde6b1603f9e3768d316636c249d78aa5795e39131164007a71270c32434d03a588c2216a0559321479cee70c5244ff459a0c686cfca2e4414f5facaa5e337
@@ -5,6 +5,8 @@ module Debitcredit
5
5
 
6
6
  validates :name, :balance, presence: true
7
7
 
8
+ validates :balance, numericality: {greater_than_or_equal_to: 0}, unless: :overdraft_enabled?
9
+
8
10
  scope :asset, ->{where(type: AssetAccount.name)}
9
11
  scope :equity, ->{where(type: EquityAccount.name)}
10
12
  scope :liability, ->{where(type: LiabilityAccount.name)}
@@ -0,0 +1,5 @@
1
+ class AddAccountOverdraft < ActiveRecord::Migration
2
+ def change
3
+ add_column :debitcredit_accounts, :overdraft_enabled, :boolean, null: false, default: true
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Debitcredit
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debitcredit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Kushner
@@ -202,6 +202,7 @@ files:
202
202
  - db/migrate/20140121181326_create_debitcredit_items.rb
203
203
  - db/migrate/20140128131859_add_transaction_parent.rb
204
204
  - db/migrate/20140128134203_longer_account_name.rb
205
+ - db/migrate/20140128153104_add_account_overdraft.rb
205
206
  - lib/debitcredit/engine.rb
206
207
  - lib/debitcredit/version.rb
207
208
  - lib/debitcredit.rb