administrate-field-money 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce29868870d5f9dda2388d6a941f7f681ca91bfa
4
- data.tar.gz: 3baad865093b0fd706deccd4b65350e5801f8191
3
+ metadata.gz: 95662930ddcfa174be4c78ffb58846b06c987dea
4
+ data.tar.gz: 6e46ef4d320079da61fd3a6ef40c66d70eadf088
5
5
  SHA512:
6
- metadata.gz: 118e8604530c18a581d759e8ace8e22b4d4992936b3cc60c4a115ef705ee79919f180ff4b3832ed07e935451d116018ba282e0832ef460ea73e898d6bc79f67d
7
- data.tar.gz: f37ec19015b36e22c5d2d0c26a91a950087b0aeaa133ea3530eb4551a808135b8175dea6641dd84049a464ce2d06bfb8c089acdd9d246710a00f451a6fdd7fab
6
+ metadata.gz: 83a9ea78a4d4c5137922697030936c2977422d329092840b36716d82aadbe0dbca4c8815aadf0b27be3f0b982eb6698d85c9a499c0e5e4e7eddef9f05403b614
7
+ data.tar.gz: 103275818cdbf5f8e5422738cf8f7d3f5ec8de61b763a20f4a44d3c5f1b0f9127fcfd5d16ac0a64961e14833a7474ccd34e62ffd52a6ae661a17daae4a9b05b9
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## [v0.0.2](https://github.com/z-productions/administrate-field-money/tree/v0.0.2) (2016-11-14)
4
+ [Full Changelog](https://github.com/z-productions/administrate-field-money/compare/v0.0.1...v0.0.2)
5
+
6
+ **Implemented enhancements**:
7
+
8
+ * Allow customization of symbol, delimiter and separator via options
9
+
10
+ ## [v0.0.1](https://github.com/z-productions/administrate-field-money/tree/v0.0.1) (2016-11-11)
11
+ First release
data/README.md CHANGED
@@ -26,7 +26,12 @@ Add to your `FooDashboard`:
26
26
 
27
27
  ```ruby
28
28
  ATTRIBUTE_TYPES = {
29
- bar: Field::Money.with_options(unit: 'USD'), # EUR, CAD, GBP, AUD, JPY, ...
29
+ bar: Field::Money.with_options(
30
+ unit: 'USD', # EUR, CAD, GBP, AUD, JPY, ...
31
+ symbol: '$',
32
+ delimiter: ',',
33
+ separator: '.'
34
+ ),
30
35
  }.freeze
31
36
  ```
32
37
  The field will figure out the appropriate thousand separator and decimal delimiter for the unit.
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'administrate-field-money'
5
- gem.version = '0.0.1'
5
+ gem.version = '0.0.2'
6
6
  gem.authors = ['Michele Gerarduzzi']
7
7
  gem.email = ['michele.gerarduzzi@gmail.com']
8
8
  gem.homepage = 'https://github.com/z-productions/administrate-field-money'
@@ -18,6 +18,6 @@ that gets submitted with the form.
18
18
  </div>
19
19
  <div class="field-unit__field">
20
20
  <%= text_field_tag field.attribute, field.data, class: 'maskmoney',
21
- data: { prefix: field.money.symbol, thousands: field.money.separator, decimal: field.money.delimiter } %>
21
+ data: { prefix: field.symbol, thousands: field.delimiter, decimal: field.separator } %>
22
22
  <%= f.hidden_field field.attribute %>
23
23
  </div>
@@ -9,7 +9,7 @@ module Administrate
9
9
  end
10
10
 
11
11
  def to_s
12
- money.format
12
+ money.format(symbol: symbol, separator: separator, delimiter: delimiter)
13
13
  end
14
14
 
15
15
  def money
@@ -19,6 +19,18 @@ module Administrate
19
19
  def code
20
20
  options.fetch(:code, 'USD')
21
21
  end
22
+
23
+ def symbol
24
+ options.fetch(:symbol, money.symbol)
25
+ end
26
+
27
+ def delimiter
28
+ options.fetch(:delimiter, money.delimiter)
29
+ end
30
+
31
+ def separator
32
+ options.fetch(:separator, money.separator)
33
+ end
22
34
  end
23
35
  end
24
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michele Gerarduzzi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-11 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - CHANGELOG.md
63
64
  - Gemfile
64
65
  - Gemfile.lock
65
66
  - LICENSE.md