has_accounts 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6aeb8e74a2096a1b176b525d637ae332a7e79a8
4
- data.tar.gz: 22f846f82b69a491ed8420f24ed3fa060b4a51ce
3
+ metadata.gz: 06d316a3fd4a7b490063349460f0140a921f6c26
4
+ data.tar.gz: 9bf3cca646fe8891cdec4b63cd0c5f583f13a3e5
5
5
  SHA512:
6
- metadata.gz: a87a98861b29fb1adeef3292b03375c3a1e6bfa0002f2fdb24da06a312eeb950cbeb749cf8307c866d61c28242fd27d916e8d87b5183667abf94992c149d7104
7
- data.tar.gz: f5b67302cd6db63c827fcdb26ba4b34362ee0a8e8aa6c89b30978c189dd56ac6c63c0bec3e155405b888927a5a30280bbac558e40e5c8e39124e3dda4eae0baa
6
+ metadata.gz: 56e43de8b3f4a065ee84a68028876e5a1a0faea6e9ccd07dce4fc636ddfde0ee6d909db4b1988ee347c717acd85886981bdcb6cb3d863ae5ab2899ce1d22a2da
7
+ data.tar.gz: adbcaece3c6db8dcbf2abe90242cf2810827e340391ea7b04b2c89fdd34ebc80789a95c7043828e67958ec1f799f57f7b86bb0827ffac9dfdc0374ea6b7b8877
@@ -197,8 +197,8 @@ class Booking < ActiveRecord::Base
197
197
  when :long
198
198
  "%s: %s an %s CHF %s, %s (%s)" % [
199
199
  value_date ? value_date : '?',
200
- credit_account ? "#{credit_account.title} (#{credit_account.code})" : '?',
201
200
  debit_account ? "#{debit_account.title} (#{debit_account.code})" : '?',
201
+ credit_account ? "#{credit_account.title} (#{credit_account.code})" : '?',
202
202
  amount ? "%0.2f" % amount : '?',
203
203
  title.present? ? title : '?',
204
204
  comments.present? ? comments : '?'
@@ -206,8 +206,8 @@ class Booking < ActiveRecord::Base
206
206
  else
207
207
  "%s: %s / %s CHF %s" % [
208
208
  value_date ? value_date : '?',
209
- credit_account ? credit_account.code : '?',
210
209
  debit_account ? debit_account.code : '?',
210
+ credit_account ? credit_account.code : '?',
211
211
  amount ? "%0.2f" % amount : '?',
212
212
  ]
213
213
  end
@@ -272,8 +272,12 @@ class Booking < ActiveRecord::Base
272
272
  # TODO: support reference_type for polymorphic changes
273
273
  reference_id_changes = changes[:reference_id]
274
274
  if reference_id_changes && (previous_reference_id = reference_id_changes[0])
275
- previous_reference = reference_type.constantize.find(previous_reference_id)
276
- previous_reference.touch if previous_reference != reference
275
+ # Guard against disappeared previous reference
276
+ begin
277
+ previous_reference = reference_type.constantize.find(previous_reference_id)
278
+ previous_reference.touch if previous_reference != reference
279
+ rescue
280
+ end
277
281
  end
278
282
  end
279
283
 
@@ -22,14 +22,14 @@ class BookingTemplate < ActiveRecord::Base
22
22
  case format
23
23
  when :short
24
24
  "%s / %s %s" % [
25
- credit_account ? credit_account.to_s(:short) : '?',
26
25
  debit_account ? debit_account.to_s(:short) : '?',
26
+ credit_account ? credit_account.to_s(:short) : '?',
27
27
  amount ? "%0.2f" % amount.to_f : '?',
28
28
  ]
29
29
  when :long
30
30
  "%s an %s %s, %s (%s)" % [
31
- credit_account ? credit_account.to_s : '?',
32
31
  debit_account ? debit_account.to_s : '?',
32
+ credit_account ? credit_account.to_s : '?',
33
33
  amount ? "%0.2f" % amount.to_f : '?',
34
34
  title.present? ? title : '?',
35
35
  comments.present? ? comments : '?'
@@ -1,3 +1,3 @@
1
1
  module HasAccounts
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_accounts
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Hürlimann (CyT)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-08 00:00:00.000000000 Z
11
+ date: 2015-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -89,8 +89,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.2.2
92
+ rubygems_version: 2.4.5
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: HasAccounts provides models for financial accounting.
96
96
  test_files: []
97
+ has_rdoc: