has_accounts 0.10.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,14 @@ class Account < ActiveRecord::Base
26
26
  !is_asset_account?
27
27
  end
28
28
 
29
+ def is_balance_account?
30
+ Account.by_type(['current_assets', 'capital_assets', 'outside_capital', 'equity_capital']).exists?(self)
31
+ end
32
+
33
+ def is_profit_account?
34
+ !is_balance_account?
35
+ end
36
+
29
37
  scope :by_type, lambda {|value| includes(:account_type).where('account_types.name' => value)} do
30
38
  include AccountScopeExtension
31
39
  end
@@ -1,3 +1,3 @@
1
1
  module HasAccounts
2
- VERSION = "0.10.1"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_accounts
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 10
9
- - 1
10
- version: 0.10.1
8
+ - 11
9
+ - 0
10
+ version: 0.11.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-10 00:00:00 +02:00
18
+ date: 2011-08-22 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21