Update money-rails gem

This commit is contained in:
Artur Beljajev 2018-09-06 00:32:58 +03:00
parent 98a95ec592
commit 3633d44822
3 changed files with 21 additions and 78 deletions

View file

@ -217,7 +217,8 @@ GEM
httpi (2.4.2)
rack
socksify
i18n (0.8.6)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
i18n_data (0.7.0)
ice_nine (0.11.2)
isikukood (0.1.2)
@ -252,15 +253,14 @@ GEM
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
monetize (1.6.0)
money (~> 6.8)
money (6.8.3)
i18n (>= 0.6.4, < 0.9)
sixarm_ruby_unaccent (>= 1.1.1, < 2)
money-rails (1.8.0)
monetize (1.9.0)
money (~> 6.12)
money (6.12.0)
i18n (>= 0.6.4, < 1.1)
money-rails (1.12.0)
activesupport (>= 3.0)
monetize (~> 1.6.0)
money (~> 6.8.1)
monetize (~> 1.9.0)
money (~> 6.12.0)
railties (>= 3.0)
multi_json (1.13.1)
mustermann (1.0.2)
@ -397,7 +397,7 @@ GEM
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
sixarm_ruby_unaccent (1.1.1)
sixarm_ruby_unaccent (1.2.0)
slop (3.6.0)
socksify (1.7.1)
sprockets (3.7.2)
@ -508,4 +508,4 @@ DEPENDENCIES
whenever (= 0.9.4)
BUNDLED WITH
1.16.2
1.16.4

View file

@ -1,69 +1,4 @@
# encoding : utf-8
MoneyRails.configure do |config|
# To set the default currency
#
# Wrapper for Money#default_currency with additional functionality
config.default_currency = :eur
# Set default bank object
#
# Example:
# config.default_bank = EuCentralBank.new
# Add exchange rates to current money bank object.
# (The conversion rate refers to one direction only)
#
# Example:
# config.add_rate "USD", "CAD", 1.24515
# config.add_rate "CAD", "USD", 0.803115
# To handle the inclusion of validations for monetized fields
# The default value is true
#
# config.include_validations = true
# Default ActiveRecord migration configuration values for columns:
#
# config.amount_column = { prefix: '', # column name prefix
# postfix: '_cents', # column name postfix
# column_name: nil, # full column name (overrides prefix, postfix and accessor name)
# type: :integer, # column type
# present: true, # column will be created
# null: false, # other options will be treated as column options
# default: 0
# }
#
# config.currency_column = { prefix: '',
# postfix: '_currency',
# column_name: nil,
# type: :string,
# present: true,
# null: false,
# default: 'USD'
# }
# Register a custom currency
#
# Example:
# config.register_currency = {
# :priority => 1,
# :iso_code => "EU4",
# :name => "Euro with subunit of 4 digits",
# :symbol => "€",
# :symbol_first => true,
# :subunit => "Subcent",
# :subunit_to_unit => 10000,
# :thousands_separator => ".",
# :decimal_mark => ","
# }
# Set default money format globally.
# Default value is nil meaning "ignore this option".
# Example:
#
# config.default_format = {
# :no_cents_if_whole => nil,
# :symbol => nil,
# :sign_before_symbol => nil
# }
end
end

View file

@ -0,0 +1,8 @@
require 'test_helper'
class MoneyLearningTest < ActiveSupport::TestCase
def test_default_currency_is_euro
money = Money.from_amount(1)
assert_equal Money::Currency.new(:eur), money.currency
end
end