has_accounts 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/account.rb +1 -0
- data/app/models/account.rb~ +2 -2
- data/app/models/account_type.rb +3 -0
- data/app/models/account_type.rb~ +6 -0
- metadata +3 -2
data/app/models/account.rb
CHANGED
data/app/models/account.rb~
CHANGED
@@ -18,14 +18,14 @@ class Account < ActiveRecord::Base
|
|
18
18
|
belongs_to :account_type
|
19
19
|
|
20
20
|
def is_asset_account?
|
21
|
-
|
21
|
+
Account.by_type(['current_assets', 'capital_assets', 'costs']).exists?(self)
|
22
22
|
end
|
23
23
|
|
24
24
|
def is_liability_account?
|
25
25
|
!is_asset_account?
|
26
26
|
end
|
27
27
|
|
28
|
-
scope :by_type, lambda {|value| includes(:account_type).where('account_types.name' => value
|
28
|
+
scope :by_type, lambda {|value| includes(:account_type).where('account_types.name' => value)} do
|
29
29
|
include AccountScopeExtension
|
30
30
|
end
|
31
31
|
|
data/app/models/account_type.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
8
|
+
- 1
|
9
|
+
version: 0.8.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Simon H\xC3\xBCrlimann (CyT)"
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- app/models/bank.rb
|
34
34
|
- app/models/account.rb
|
35
35
|
- app/models/booking.rb
|
36
|
+
- app/models/account_type.rb~
|
36
37
|
- app/models/account_type.rb
|
37
38
|
- app/models/bank_account.rb
|
38
39
|
- app/models/booking.rb~
|