has_accounts 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/booking.rb +8 -4
- data/app/models/booking_template.rb +2 -2
- data/lib/has_accounts/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06d316a3fd4a7b490063349460f0140a921f6c26
|
4
|
+
data.tar.gz: 9bf3cca646fe8891cdec4b63cd0c5f583f13a3e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e43de8b3f4a065ee84a68028876e5a1a0faea6e9ccd07dce4fc636ddfde0ee6d909db4b1988ee347c717acd85886981bdcb6cb3d863ae5ab2899ce1d22a2da
|
7
|
+
data.tar.gz: adbcaece3c6db8dcbf2abe90242cf2810827e340391ea7b04b2c89fdd34ebc80789a95c7043828e67958ec1f799f57f7b86bb0827ffac9dfdc0374ea6b7b8877
|
data/app/models/booking.rb
CHANGED
@@ -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
|
-
|
276
|
-
|
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 : '?'
|
data/lib/has_accounts/version.rb
CHANGED
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.
|
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:
|
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.
|
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:
|