debitcredit 0.0.6 → 0.0.7

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: 2ddfbe9149c881d0409f7b3fa09807124b95f792
4
- data.tar.gz: c56cf08f5ff9df370f6f7823bea30fa5ff1cebdc
3
+ metadata.gz: df64b49793f6e14d759a23a7685e5a38e0dc87cf
4
+ data.tar.gz: 3f50cb6ed56a4952d7ca7405fa3ad339c62fd1ea
5
5
  SHA512:
6
- metadata.gz: 0e546eb72ee89de8ffb0af9fedb64af323d083b856bcf0c96ae86202bfd41fa0763a3459df7d88c2206aaf41098a508ef1a19867f77a57f42634330a0458494d
7
- data.tar.gz: 0e254ee5fd412b4173abdd0a2604bd60fb39e0b3a66c3ee8e6650a17e56be1962eb5b2f4f0703fdb3e400418c0580221b5e48b482a8d24200954f3ac130c8b7a
6
+ metadata.gz: 1535f507354e1cf4118dfb47f6cd0da1b1a4114f5dbbf8921afb5c5ec439037a0764e0ebaaca4d4cd6b528dbbb5bae893ef051c39dddb1c58e1c163f458e9ec3
7
+ data.tar.gz: 8ab04eeda5d4f006031f70eac05e85efd24e28d07ea987b7b162211ecc7f652f988f2b9bc6ea870bfb0d379ee811f0b32eec82be5155f497644cb81a9f4583cd
data/README.md CHANGED
@@ -86,7 +86,11 @@ Or better yet:
86
86
  include Debitcredit::Extension
87
87
 
88
88
  has_accounts
89
- has_transactions
89
+ has_transactions do
90
+ def pay!
91
+ ...
92
+ end
93
+ end
90
94
  end
91
95
 
92
96
  By default accounts are prevented from having a negative balance, but you can
@@ -14,12 +14,17 @@ module Debitcredit
14
14
  def has_accounts(&block)
15
15
  has_many :accounts, as: :reference, class_name: 'Debitcredit::Account', inverse_of: :reference do
16
16
  extend ProxyMethods
17
- instance_eval &block
17
+ instance_eval &block if block
18
18
  end
19
19
  end
20
20
 
21
- def has_transactions &block
22
- has_many :transactions, as: :reference, class_name: 'Debitcredit::Transaction', &block
21
+ def has_transactions(&block)
22
+ has_many :transactions, as: :reference, class_name: 'Debitcredit::Transaction' do
23
+ def [](kind)
24
+ find_by kind: kind
25
+ end
26
+ instance_eval &block if block
27
+ end
23
28
  end
24
29
  end
25
30
  end
@@ -1,3 +1,3 @@
1
1
  module Debitcredit
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debitcredit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Kushner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-08 00:00:00.000000000 Z
11
+ date: 2014-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails