dm-money 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Gemfile +1 -1
  2. data/README.rdoc +14 -0
  3. data/Rakefile +1 -1
  4. data/VERSION +1 -1
  5. metadata +3 -3
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ bundle_path 'gems'
4
4
  disable_rubygems
5
5
  disable_system_gems
6
6
 
7
- gem 'big_money', '~> 1.1.0'
7
+ gem 'big_money', '~> 1.1'
8
8
  gem 'dm-core', '>= 0.10'
9
9
 
10
10
  only :development do
@@ -7,6 +7,8 @@ BigMoney backed DataMapper money properties.
7
7
  == Todo
8
8
 
9
9
  * Validations.
10
+ * Precision and scale options should also be applied to underlying BigMoney/BigDecimal amount.
11
+ * A rounding mode option, see BigDecimal#mode.
10
12
 
11
13
  == Synopsis
12
14
 
@@ -46,11 +48,23 @@ BigMoney backed DataMapper money properties.
46
48
  # property :price_currency, String, accessor: private, required: true, length: 3
47
49
  end
48
50
 
51
+ == Precision and Scale
52
+
53
+ "The SQL standard requires a default scale of 0, i.e. coercion to integer precision. We find this a bit useless. If
54
+ you're concerned about portability, always specify the precision and scale explicitly." -- PostgreSQL Documentation.
55
+
56
+ DataMapper's bread and butter is SQL and old school relational databases so unsurprisingly a default numeric/decimal
57
+ scale of 0 is used (where the default precision comes from I do not know).
58
+
59
+ If you require any fractional money amounts remember to explicitly set the precision and scale options for each money
60
+ property.
61
+
49
62
  == Install
50
63
 
51
64
  * Via git:
52
65
 
53
66
  git clone git://github.com/shanna/dm-money.git
67
+ cd dm-money && rake install
54
68
 
55
69
  * Via gem:
56
70
 
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ begin
14
14
  gem.homepage = 'http://github.com/shanna/dm-money'
15
15
  gem.authors = ['Shane Hanna']
16
16
  gem.executables = [] # Only ever bundled development executables in bin/*
17
- gem.add_dependency 'big_money', '~> 1.1.0'
17
+ gem.add_dependency 'big_money', '~> 1.1'
18
18
  gem.add_dependency 'dm-core', '>= 0.10'
19
19
  end
20
20
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Hanna
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-09 00:00:00 +11:00
12
+ date: 2010-05-27 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 1.1.0
23
+ version: "1.1"
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: dm-core