billing 0.0.4d → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/billing/accounts.js +2 -0
  3. data/app/assets/javascripts/billing/application.js +13 -0
  4. data/app/assets/javascripts/billing/charges.js +2 -0
  5. data/app/assets/javascripts/billing/modifiers.js +2 -0
  6. data/app/assets/stylesheets/billing/accounts.css +4 -0
  7. data/app/assets/stylesheets/billing/application.css +15 -0
  8. data/app/assets/stylesheets/billing/charges.css +4 -0
  9. data/app/assets/stylesheets/billing/modifiers.css +4 -0
  10. data/app/assets/stylesheets/billing/payments.css +4 -0
  11. data/app/controllers/billing/accounts_controller.rb +29 -0
  12. data/app/controllers/billing/application_controller.rb +22 -0
  13. data/app/controllers/billing/charges_controller.rb +29 -0
  14. data/app/controllers/billing/modifiers_controller.rb +29 -0
  15. data/app/controllers/billing/payments_controller.rb +29 -0
  16. data/app/helpers/billing/accounts_helper.rb +4 -0
  17. data/app/helpers/billing/application_helper.rb +4 -0
  18. data/app/helpers/billing/charges_helper.rb +4 -0
  19. data/app/helpers/billing/modifiers_helper.rb +4 -0
  20. data/app/helpers/billing/payments_helper.rb +4 -0
  21. data/app/models/billing/{bill.rb → account.rb} +30 -37
  22. data/app/models/billing/charge.rb +11 -25
  23. data/app/models/billing/modifier.rb +5 -5
  24. data/app/models/billing/origin.rb +2 -7
  25. data/app/models/billing/payment.rb +11 -8
  26. data/app/models/billing/payment_with_type.rb +1 -1
  27. data/app/models/billing/report.rb +12 -23
  28. data/app/models/concerns/billing/{bill_item.rb → account_item.rb} +6 -5
  29. data/app/views/billing/accounts/index.html.erb +7 -0
  30. data/app/views/billing/accounts/new.html.erb +8 -0
  31. data/app/views/billing/accounts/show.html.erb +29 -0
  32. data/app/views/billing/application/index.html.erb +3 -0
  33. data/app/views/billing/charges/new.html.erb +12 -0
  34. data/app/views/billing/modifiers/new.html.erb +18 -0
  35. data/app/views/billing/payments/new.html.erb +11 -0
  36. data/app/views/layouts/billing/application.html.erb +14 -0
  37. data/config/routes.rb +6 -1
  38. data/lib/billing.rb +2 -0
  39. data/lib/billing/billable.rb +3 -3
  40. data/lib/billing/engine.rb +0 -3
  41. data/lib/billing/mapping.rb +32 -0
  42. data/lib/billing/routes.rb +16 -0
  43. data/lib/billing/version.rb +1 -1
  44. data/test/controllers/billing/accounts_controller_test.rb +19 -0
  45. data/test/controllers/billing/charges_controller_test.rb +16 -0
  46. data/test/controllers/billing/modifiers_controller_test.rb +16 -0
  47. data/test/controllers/billing/payments_controller_test.rb +16 -0
  48. data/test/dummy/config/routes.rb +3 -1
  49. data/test/dummy/db/development.sqlite3 +0 -0
  50. data/test/dummy/db/schema.rb +17 -23
  51. data/test/dummy/db/test.sqlite3 +0 -0
  52. data/test/dummy/log/development.log +0 -8144
  53. data/test/dummy/log/test.log +0 -64325
  54. data/test/fixtures/billing/{bills.yml → accounts.yml} +0 -0
  55. data/test/fixtures/billing/charges.yml +2 -2
  56. data/test/fixtures/billing/modifiers.yml +2 -2
  57. data/test/fixtures/billing/payments.yml +2 -2
  58. data/test/helpers/billing/accounts_helper_test.rb +6 -0
  59. data/test/helpers/billing/charges_helper_test.rb +6 -0
  60. data/test/helpers/billing/modifiers_helper_test.rb +6 -0
  61. data/test/helpers/billing/payments_helper_test.rb +6 -0
  62. data/test/integration/navigation_test.rb +10 -0
  63. data/test/models/billing/account_test.rb +56 -0
  64. data/test/models/billing/charge_test.rb +6 -13
  65. data/test/models/billing/modifier_test.rb +2 -2
  66. data/test/models/billing/payment_test.rb +12 -12
  67. metadata +58 -20
  68. data/app/models/billing/room_transfer.rb +0 -4
  69. data/app/models/concerns/billing/bill_text_parser.rb +0 -18
  70. data/config/initializers/money.rb +0 -67
  71. data/db/migrate/20140803073707_rename_billing_account_to_bill.rb +0 -8
  72. data/db/migrate/20140804065726_add_qty_to_billing_charge.rb +0 -5
  73. data/db/migrate/20140804070517_add_tax_ratio_to_billing_charge.rb +0 -5
  74. data/db/migrate/20141001185321_add_transfer_device_to_billing_origin.rb +0 -5
  75. data/db/migrate/20141027235427_add_f_amount_to_billing_report.rb +0 -7
  76. data/lib/collection_proxy_wild.rb +0 -9
  77. data/test/models/billing/bill_test.rb +0 -76
File without changes
@@ -5,11 +5,11 @@
5
5
  # below each fixture, per the syntax in the comments below
6
6
  #
7
7
  one:
8
- bill: one
8
+ account: one
9
9
  price_cents: 100
10
10
  price_currency: USD
11
11
 
12
12
  two:
13
- bill: one
13
+ account: one
14
14
  price_cents: 200
15
15
  price_currency: USD
@@ -5,11 +5,11 @@
5
5
  # below each fixture, per the syntax in the comments below
6
6
  #
7
7
  one:
8
- bill: one
8
+ account: one
9
9
  percent_ratio: 1.0
10
10
 
11
11
  two:
12
- bill: one
12
+ account: one
13
13
  charge: one
14
14
  fixed_value_cents: 100
15
15
  fixed_value_currency: 'USD'
@@ -5,14 +5,14 @@
5
5
  # below each fixture, per the syntax in the comments below
6
6
  #
7
7
  one:
8
- bill: one
8
+ account: one
9
9
  value_cents: 100
10
10
  value_currency: USD
11
11
  payment_type: one
12
12
  type: Billing::PaymentWithType
13
13
 
14
14
  two:
15
- bill: one
15
+ account: one
16
16
  value_cents: 200
17
17
  value_currency: USD
18
18
  payment_type: one
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class AccountsHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class ChargesHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class ModifiersHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class PaymentsHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ fixtures :all
5
+
6
+ # test "the truth" do
7
+ # assert true
8
+ # end
9
+ end
10
+
@@ -0,0 +1,56 @@
1
+ require 'test_helper'
2
+
3
+ module Billing
4
+ class AccountTest < ActiveSupport::TestCase
5
+ setup do
6
+ @account = billing_accounts(:one)
7
+ @account.save! # force summary calculation
8
+ end
9
+
10
+ test "charge" do
11
+ charge = @account.charge 3
12
+ assert charge.try(:persisted?)
13
+ assert_equal '13 USD'.to_money, @account.total # (1 + 3) + 100% + $1
14
+ end
15
+
16
+ test "discount" do
17
+ discount = @account.modify(-1.00, charge: billing_charges(:two))
18
+ assert discount.try(:persisted?)
19
+ assert_equal '6 USD'.to_money, @account.total
20
+ end
21
+
22
+ test "surcharge" do
23
+ surcharge = @account.modify(1.00, charge: billing_charges(:two))
24
+ assert surcharge.try(:persisted?)
25
+ assert_equal '8 USD'.to_money, @account.total
26
+ end
27
+
28
+ test "pay" do
29
+ payment = @account.pay billing_payment_types(:one)
30
+ assert @account.balance.zero?, @account.errors.full_messages.join(', ')
31
+ assert_equal '7 USD'.to_money, @account.payments_sum
32
+ end
33
+
34
+ test "validate positive total" do
35
+ assert @account.save
36
+ @account.modify(-500)
37
+ assert @account.errors.messages[:total]
38
+ assert_raise ActiveRecord::RecordInvalid do
39
+ @account.save!
40
+ end
41
+ end
42
+
43
+ test "account with payments should have origin" do
44
+ assert @account.origin
45
+ assert @account.payments.any?
46
+ @account.origin = nil
47
+ assert_equal false, @account.save
48
+ assert @account.errors.messages[:origin]
49
+ end
50
+
51
+ test "autofin" do
52
+ assert @account.pay billing_payment_types(:one)
53
+ assert @account.finalized_at
54
+ end
55
+ end
56
+ end
@@ -6,19 +6,12 @@ module Billing
6
6
  @charge = billing_charges(:one)
7
7
  end
8
8
 
9
- test "wild class method" do
10
- assert_equal Billing::Charge.new(Billing::Charge.wild(1)).price, '1 USD'.to_money
11
- assert_equal Billing::Charge.new(Billing::Charge.wild("1")).price, '1 USD'.to_money
12
- assert_equal Billing::Charge.new(Billing::Charge.wild("1EUR")).price, '1 EUR'.to_money
13
- assert_equal Billing::Charge.new(Billing::Charge.wild('1', price_currency: 'EUR')).price, '1 EUR'.to_money
14
- assert_equal Billing::Charge.new(Billing::Charge.wild(price: 10, price_currency: 'EUR')).price, '10 EUR'.to_money
15
- end
16
-
17
- test "string protocol" do
18
- charge = Billing::Charge.new Billing::Charge.wild("2.5*3.5##{billing_plus(:one).id}@#{billing_tax_groups(:one).id}+1.5%/Umbrella")
19
- assert_equal charge.price, '3.5 USD'.to_money
20
- assert_equal charge.name, 'Umbrella'
21
- #p charge
9
+ test "args_to_attributes class method" do
10
+ assert_equal Billing::Charge.args(1), { price: '1 USD'.to_money }
11
+ assert_equal Billing::Charge.args("1"), { price: '1 USD'.to_money }
12
+ assert_equal Billing::Charge.args("1 EUR"), { price: '1 EUR'.to_money }
13
+ assert_equal Billing::Charge.args(1, price_currency: 'USD'), { price: '1 USD'.to_money, price_currency: 'USD' }
14
+ assert_equal Billing::Charge.args(price: 10, price_currency: 'EUR'), { price: 10, price_currency: 'EUR' }
22
15
  end
23
16
  end
24
17
  end
@@ -22,10 +22,10 @@ module Billing
22
22
  assert mod.errors[:charge]
23
23
  end
24
24
 
25
- test "allow only one global bill modifier" do
25
+ test "allow only one global account modifier" do
26
26
  mod = billing_modifiers(:two).dup
27
27
  assert_equal false, mod.save
28
- assert mod.errors[:bill]
28
+ assert mod.errors[:account]
29
29
  end
30
30
 
31
31
  end
@@ -4,7 +4,7 @@ module Billing
4
4
  class PaymentTest < ActiveSupport::TestCase
5
5
  setup do
6
6
  @payment = billing_payments(:one)
7
- @bill = @payment.bill
7
+ @account = @payment.account
8
8
  end
9
9
 
10
10
  # test "args_to_attributes class method" do
@@ -16,27 +16,27 @@ module Billing
16
16
  # end
17
17
 
18
18
  test "create" do
19
- assert_equal 'Billing::PaymentWithType', @bill.origin_payment_model
20
- assert @bill.payments.create(type: 'Billing::PaymentWithType', value: 1, payment_type_id: @payment.payment_type_id).persisted?, "Can't create payment"
19
+ assert_equal 'Billing::PaymentWithType', @account.origin_payment_model
20
+ assert @account.payments.create(type: 'Billing::PaymentWithType', value: 1, payment_type_id: @payment.payment_type_id).persisted?, "Can't create payment"
21
21
  end
22
22
 
23
- test "should be instance of bill's origin_payment_model" do
24
- payment = @bill.payments.new(type: 'Billing::Payment', value: 1, payment_type_id: @payment.payment_type_id)
23
+ test "should be instance of account's origin_payment_model" do
24
+ payment = @account.payments.new(type: 'Billing::Payment', value: 1, payment_type_id: @payment.payment_type_id)
25
25
  assert !payment.save
26
- assert payment.errors.messages[:bill]
26
+ assert payment.errors.messages[:account]
27
27
  end
28
28
 
29
- test "should have same fiscal flag as other bill payments" do
30
- payment = @bill.payments.new(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:fiscal).id)
29
+ test "should have same fiscal flag as other account payments" do
30
+ payment = @account.payments.new(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:fiscal).id)
31
31
  assert !payment.save
32
- assert payment.errors.messages[:bill]
32
+ assert payment.errors.messages[:account]
33
33
  end
34
34
 
35
35
  test "should be single cash payments" do
36
- @bill.payments.create!(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:cash).id)
37
- payment = @bill.payments.new(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:cash).id)
36
+ @account.payments.create!(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:cash).id)
37
+ payment = @account.payments.new(type: 'Billing::PaymentWithType', value: 1, payment_type_id: billing_payment_types(:cash).id)
38
38
  assert !payment.save
39
- assert payment.errors.messages[:bill]
39
+ assert payment.errors.messages[:account]
40
40
  end
41
41
  end
42
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4d
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-28 00:00:00.000000000 Z
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Provides billing for an ActiveRecord model
69
+ description: Provides billing accounts for an ActiveRecord model
70
70
  email:
71
71
  - email@data.bg
72
72
  executables: []
@@ -76,7 +76,26 @@ files:
76
76
  - MIT-LICENSE
77
77
  - README.rdoc
78
78
  - Rakefile
79
- - app/models/billing/bill.rb
79
+ - app/assets/javascripts/billing/accounts.js
80
+ - app/assets/javascripts/billing/application.js
81
+ - app/assets/javascripts/billing/charges.js
82
+ - app/assets/javascripts/billing/modifiers.js
83
+ - app/assets/stylesheets/billing/accounts.css
84
+ - app/assets/stylesheets/billing/application.css
85
+ - app/assets/stylesheets/billing/charges.css
86
+ - app/assets/stylesheets/billing/modifiers.css
87
+ - app/assets/stylesheets/billing/payments.css
88
+ - app/controllers/billing/accounts_controller.rb
89
+ - app/controllers/billing/application_controller.rb
90
+ - app/controllers/billing/charges_controller.rb
91
+ - app/controllers/billing/modifiers_controller.rb
92
+ - app/controllers/billing/payments_controller.rb
93
+ - app/helpers/billing/accounts_helper.rb
94
+ - app/helpers/billing/application_helper.rb
95
+ - app/helpers/billing/charges_helper.rb
96
+ - app/helpers/billing/modifiers_helper.rb
97
+ - app/helpers/billing/payments_helper.rb
98
+ - app/models/billing/account.rb
80
99
  - app/models/billing/charge.rb
81
100
  - app/models/billing/department.rb
82
101
  - app/models/billing/modifier.rb
@@ -92,12 +111,17 @@ files:
92
111
  - app/models/billing/plu.rb
93
112
  - app/models/billing/profile.rb
94
113
  - app/models/billing/report.rb
95
- - app/models/billing/room_transfer.rb
96
114
  - app/models/billing/tax_group.rb
97
115
  - app/models/billing/version.rb
98
- - app/models/concerns/billing/bill_item.rb
99
- - app/models/concerns/billing/bill_text_parser.rb
100
- - config/initializers/money.rb
116
+ - app/models/concerns/billing/account_item.rb
117
+ - app/views/billing/accounts/index.html.erb
118
+ - app/views/billing/accounts/new.html.erb
119
+ - app/views/billing/accounts/show.html.erb
120
+ - app/views/billing/application/index.html.erb
121
+ - app/views/billing/charges/new.html.erb
122
+ - app/views/billing/modifiers/new.html.erb
123
+ - app/views/billing/payments/new.html.erb
124
+ - app/views/layouts/billing/application.html.erb
101
125
  - config/initializers/paper_trail.rb
102
126
  - config/routes.rb
103
127
  - db/migrate/20140717180443_create_billing_accounts.rb
@@ -144,19 +168,19 @@ files:
144
168
  - db/migrate/20140729083408_add_number_to_billing_account.rb
145
169
  - db/migrate/20140729180849_add_deleted_at_to_billing_modifier.rb
146
170
  - db/migrate/20140729182146_add_deleted_at_to_billing_account.rb
147
- - db/migrate/20140803073707_rename_billing_account_to_bill.rb
148
- - db/migrate/20140804065726_add_qty_to_billing_charge.rb
149
- - db/migrate/20140804070517_add_tax_ratio_to_billing_charge.rb
150
- - db/migrate/20141001185321_add_transfer_device_to_billing_origin.rb
151
- - db/migrate/20141027235427_add_f_amount_to_billing_report.rb
152
171
  - lib/billing.rb
153
172
  - lib/billing/billable.rb
154
173
  - lib/billing/engine.rb
174
+ - lib/billing/mapping.rb
175
+ - lib/billing/routes.rb
155
176
  - lib/billing/version.rb
156
- - lib/collection_proxy_wild.rb
157
177
  - lib/tasks/billing.rake
158
178
  - lib/tasks/billing_tasks.rake
159
179
  - test/billing_test.rb
180
+ - test/controllers/billing/accounts_controller_test.rb
181
+ - test/controllers/billing/charges_controller_test.rb
182
+ - test/controllers/billing/modifiers_controller_test.rb
183
+ - test/controllers/billing/payments_controller_test.rb
160
184
  - test/dummy/README.rdoc
161
185
  - test/dummy/Rakefile
162
186
  - test/dummy/app/assets/javascripts/application.js
@@ -225,7 +249,7 @@ files:
225
249
  - test/dummy/tmp/cache/assets/test/sprockets/efaa0abeb4ad44b0ef8df996631f3997
226
250
  - test/dummy/tmp/cache/assets/test/sprockets/f393277b28dd79320611f18a379dbea7
227
251
  - test/dummy/tmp/cache/assets/test/sprockets/fbf1489a0c3d66a329f070c10cd77a03
228
- - test/fixtures/billing/bills.yml
252
+ - test/fixtures/billing/accounts.yml
229
253
  - test/fixtures/billing/charges.yml
230
254
  - test/fixtures/billing/departments.yml
231
255
  - test/fixtures/billing/modifiers.yml
@@ -237,7 +261,12 @@ files:
237
261
  - test/fixtures/billing/profiles.yml
238
262
  - test/fixtures/billing/tax_groups.yml
239
263
  - test/fixtures/profiles.yml
240
- - test/models/billing/bill_test.rb
264
+ - test/helpers/billing/accounts_helper_test.rb
265
+ - test/helpers/billing/charges_helper_test.rb
266
+ - test/helpers/billing/modifiers_helper_test.rb
267
+ - test/helpers/billing/payments_helper_test.rb
268
+ - test/integration/navigation_test.rb
269
+ - test/models/billing/account_test.rb
241
270
  - test/models/billing/charge_test.rb
242
271
  - test/models/billing/department_test.rb
243
272
  - test/models/billing/modifier_test.rb
@@ -264,9 +293,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
293
  version: '0'
265
294
  required_rubygems_version: !ruby/object:Gem::Requirement
266
295
  requirements:
267
- - - ">"
296
+ - - ">="
268
297
  - !ruby/object:Gem::Version
269
- version: 1.3.1
298
+ version: '0'
270
299
  requirements: []
271
300
  rubyforge_project:
272
301
  rubygems_version: 2.2.2
@@ -279,15 +308,19 @@ test_files:
279
308
  - test/fixtures/billing/origins.yml
280
309
  - test/fixtures/billing/plus.yml
281
310
  - test/fixtures/billing/payments.yml
282
- - test/fixtures/billing/bills.yml
283
311
  - test/fixtures/billing/charges.yml
284
312
  - test/fixtures/billing/departments.yml
285
313
  - test/fixtures/billing/modifiers.yml
286
314
  - test/fixtures/billing/profiles.yml
287
315
  - test/fixtures/billing/operators.yml
316
+ - test/fixtures/billing/accounts.yml
288
317
  - test/fixtures/billing/tax_groups.yml
289
318
  - test/fixtures/profiles.yml
290
319
  - test/test_helper.rb
320
+ - test/controllers/billing/payments_controller_test.rb
321
+ - test/controllers/billing/modifiers_controller_test.rb
322
+ - test/controllers/billing/accounts_controller_test.rb
323
+ - test/controllers/billing/charges_controller_test.rb
291
324
  - test/dummy/tmp/cache/assets/test/sprockets/6d34e4addaf3495d1d96306d164feb97
292
325
  - test/dummy/tmp/cache/assets/test/sprockets/efaa0abeb4ad44b0ef8df996631f3997
293
326
  - test/dummy/tmp/cache/assets/test/sprockets/e62907e54633a2adb53c33c1f59b79bf
@@ -356,9 +389,14 @@ test_files:
356
389
  - test/dummy/public/404.html
357
390
  - test/dummy/public/422.html
358
391
  - test/dummy/Rakefile
392
+ - test/helpers/billing/accounts_helper_test.rb
393
+ - test/helpers/billing/payments_helper_test.rb
394
+ - test/helpers/billing/modifiers_helper_test.rb
395
+ - test/helpers/billing/charges_helper_test.rb
396
+ - test/integration/navigation_test.rb
359
397
  - test/models/billing/tax_group_test.rb
398
+ - test/models/billing/account_test.rb
360
399
  - test/models/billing/plu_test.rb
361
- - test/models/billing/bill_test.rb
362
400
  - test/models/billing/department_test.rb
363
401
  - test/models/billing/payment_test.rb
364
402
  - test/models/billing/operator_test.rb
@@ -1,4 +0,0 @@
1
- module Billing
2
- class RoomTransfer < Payment
3
- end
4
- end
@@ -1,18 +0,0 @@
1
- module Billing
2
- module BillTextParser
3
-
4
- def parse_qty(qty_s)
5
- nil
6
- end
7
-
8
- def parse_plu(plu_s)
9
- nil
10
- end
11
-
12
- def parse_text(text)
13
- #p text
14
- text[1..-1] if text
15
- end
16
-
17
- end
18
- end
@@ -1,67 +0,0 @@
1
- # encoding : utf-8
2
-
3
- MoneyRails.configure do |config|
4
-
5
- # To set the default currency
6
- #
7
- # config.default_currency = :usd
8
-
9
- # Set default bank object
10
- #
11
- # Example:
12
- # config.default_bank = EuCentralBank.new
13
-
14
- # Add exchange rates to current money bank object.
15
- # (The conversion rate refers to one direction only)
16
- #
17
- # Example:
18
- # config.add_rate "USD", "CAD", 1.24515
19
- # config.add_rate "CAD", "USD", 0.803115
20
-
21
- # To handle the inclusion of validations for monetized fields
22
- # The default value is true
23
- #
24
- # config.include_validations = true
25
-
26
- # Default ActiveRecord migration configuration values for columns:
27
- #
28
- # config.amount_column = { prefix: '', # column name prefix
29
- # postfix: '_cents', # column name postfix
30
- # column_name: nil, # full column name (overrides prefix, postfix and accessor name)
31
- # type: :integer, # column type
32
- # present: true, # column will be created
33
- # null: false, # other options will be treated as column options
34
- # default: 0
35
- # }
36
- #
37
- # config.currency_column = { prefix: '',
38
- # postfix: '_currency',
39
- # column_name: nil,
40
- # type: :string,
41
- # present: true,
42
- # null: false,
43
- # default: 'USD'
44
- # }
45
-
46
- # Register a custom currency
47
- #
48
- # Example:
49
- # config.register_currency = {
50
- # :priority => 1,
51
- # :iso_code => "EU4",
52
- # :name => "Euro with subunit of 4 digits",
53
- # :symbol => "€",
54
- # :symbol_first => true,
55
- # :subunit => "Subcent",
56
- # :subunit_to_unit => 10000,
57
- # :thousands_separator => ".",
58
- # :decimal_mark => ","
59
- # }
60
-
61
- # Set money formatted output globally.
62
- # Default value is nil meaning "ignore this option".
63
- # Options are nil, true, false.
64
- #
65
- # config.no_cents_if_whole = nil
66
- # config.symbol = nil
67
- end