has_accounts 0.18.3 → 0.18.4
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/account.rb +3 -0
- data/app/models/account_type.rb +3 -0
- data/app/models/booking.rb +3 -0
- data/lib/has_accounts/model.rb +1 -1
- data/lib/has_accounts/version.rb +1 -1
- metadata +2 -2
data/app/models/account.rb
CHANGED
data/app/models/account_type.rb
CHANGED
data/app/models/booking.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
class Booking < ActiveRecord::Base
|
2
|
+
# Access restrictions
|
3
|
+
attr_accessible :title, :comments, :amount, :debit_account, :credit_account, :value_date
|
4
|
+
|
2
5
|
# Validation
|
3
6
|
validates_presence_of :debit_account, :credit_account, :title, :value_date
|
4
7
|
validates :amount, :presence => true, :numericality => true
|
data/lib/has_accounts/model.rb
CHANGED
@@ -5,7 +5,7 @@ module HasAccounts
|
|
5
5
|
included do
|
6
6
|
class_attribute :direct_account
|
7
7
|
|
8
|
-
has_many :bookings, :as => :reference, :dependent => :
|
8
|
+
has_many :bookings, :as => :reference, :dependent => :nullify, :inverse_of => :reference do
|
9
9
|
# TODO: duplicated in Booking (without parameter)
|
10
10
|
def direct_balance(value_date = nil, direct_account = nil)
|
11
11
|
return BigDecimal.new('0') unless proxy_association.owner.direct_account
|
data/lib/has_accounts/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_accounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|