has_accounts 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
data/app/models/bank.rb CHANGED
@@ -1,9 +1,11 @@
1
- class Bank < ActiveRecord::Base
1
+ class Bank < Person
2
2
  has_many :bank_accounts
3
3
 
4
4
  has_vcards
5
5
 
6
6
  def to_s
7
+ return "" unless vcard
8
+
7
9
  [vcard.full_name, vcard.locality].compact.join(', ')
8
10
  end
9
11
  end
@@ -172,7 +172,7 @@ class Booking < ActiveRecord::Base
172
172
  end
173
173
 
174
174
  # Reference
175
- belongs_to :reference, :polymorphic => true, :touch => true
175
+ belongs_to :reference, :polymorphic => true, :touch => true, :inverse_of => :bookings
176
176
  after_save :notify_references
177
177
  after_destroy :notify_references
178
178
 
@@ -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 => :destroy do
8
+ has_many :bookings, :as => :reference, :dependent => :destroy, :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_owner.direct_account
@@ -1,3 +1,3 @@
1
1
  module HasAccounts
2
- VERSION = "0.16.0"
2
+ VERSION = "0.17.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: 95
5
- prerelease: false
4
+ hash: 91
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 16
8
+ - 17
9
9
  - 0
10
- version: 0.16.0
10
+ version: 0.17.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-14 00:00:00 +01:00
19
- default_executable:
18
+ date: 2011-12-30 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: rails
@@ -103,7 +102,6 @@ files:
103
102
  - lib/has_accounts/version.rb
104
103
  - MIT-LICENSE
105
104
  - README.md
106
- has_rdoc: true
107
105
  homepage: https://github.com/huerlisi/has_accounts
108
106
  licenses:
109
107
  - MIT
@@ -133,9 +131,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
131
  requirements: []
134
132
 
135
133
  rubyforge_project:
136
- rubygems_version: 1.3.7
134
+ rubygems_version: 1.8.10
137
135
  signing_key:
138
136
  specification_version: 3
139
137
  summary: HasAccounts provides models for financial accounting.
140
138
  test_files: []
141
139
 
140
+ has_rdoc: