administrate-field-money 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec3c5ec2ef19074866c5e57896588510cc75f02da829250ff15b08ca820bb6df
4
- data.tar.gz: b3227940894385e6ba5eb6c5eaf57b34f09477161e64dafe221117115f7fe8ce
3
+ metadata.gz: 1eda523410fc7e006a80ae1687af723d11e2311b74163b836ac418ae9320abf0
4
+ data.tar.gz: cfe145471695381ef11fc91e240183ae2daf7dc11c48c91d0ac29641a293933e
5
5
  SHA512:
6
- metadata.gz: a43e143d31706668b58631c9cff5a549347b3eb0a649777a2bfbaae13d7fd6fc2ad6059ce5f1165d6ec5d2e6b940c2716a25a3f05d2b686d3acf2b1c246377db
7
- data.tar.gz: e2c55340da2d34038f7ebc575ffd02bb2db9ef21008ea3278fee927a2d1d4e3e671349338d88f9ee7b6667e8cb06a145e3a9e559882bf195a23291d60153e74d
6
+ metadata.gz: dcab1f345074b6b150f362ba72e81a745e64b7928a43ddb6b236d47eec02b79293f7ecc90fa03a591b6d6dcc844859b8e12d34dc96d8f81482457eeefeb1fdc2
7
+ data.tar.gz: 23d0e265d88eaf9896c3bd799649174d539a404fd710064d53e7fa5e82250112b52aa95eb210dd94569fa722d316a09a17c56ea5fb2aa4b50eb362e695c9ab82
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  *.gem
2
2
  Gemfile.lock
3
+ .ruby-gemset
@@ -0,0 +1 @@
1
+ 2.5.1
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.1.1](https://github.com/zooppa/administrate-field-money/tree/v0.1.1) (2018-10-11)
4
+
5
+ [Full Changelog](https://github.com/zooppa/administrate-field-money/compare/v0.1.0...v0.1.1)
6
+
7
+ * Clarify expected attribute name (thanks @pkonovalov and @MatteoJoliveau)
8
+
3
9
  ## [v0.1.0](https://github.com/zooppa/administrate-field-money/tree/v0.1.0) (2018-03-06)
4
10
 
5
11
  [Full Changelog](https://github.com/zooppa/administrate-field-money/compare/v0.0.6...v0.1.0)
data/README.md CHANGED
@@ -1,20 +1,19 @@
1
1
  # Administrate::Field::Money
2
2
 
3
- [![Code Climate](https://codeclimate.com/github/zooppa/administrate-field-money/badges/gpa.svg)](https://codeclimate.com/github/zooppa/administrate-field-money)
4
3
  [![Build Status](https://semaphoreci.com/api/v1/zooppa/administrate-field-money/branches/master/badge.svg)](https://semaphoreci.com/zooppa/administrate-field-money)
4
+ [![Code Climate](https://codeclimate.com/github/zooppa/administrate-field-money/badges/gpa.svg)](https://codeclimate.com/github/zooppa/administrate-field-money)
5
5
 
6
6
  A plugin to deal with money in [Administrate], with the help of [Money] gem.
7
7
 
8
- **Attribute must be in cents**.
9
-
10
- ![Demo](https://raw.githubusercontent.com/zooppa/administrate-field-money/master/demo.gif)
8
+ **IMPORTANT: this plugin expects the attribute to be an integer representing the
9
+ number of cents, with a name ending in `_cents`**.
11
10
 
12
11
  ## Usage
13
12
 
14
13
  Add it to your `Gemfile`:
15
14
 
16
15
  ```ruby
17
- gem 'administrate-field-money', '~> 0.1.0'
16
+ gem 'administrate-field-money', '~> 0.1.1'
18
17
  ```
19
18
 
20
19
  Run:
@@ -27,7 +26,7 @@ Add to your `FooDashboard`:
27
26
 
28
27
  ```ruby
29
28
  ATTRIBUTE_TYPES = {
30
- bar: Field::Money.with_options(
29
+ amount_cents: Field::Money.with_options(
31
30
  code: 'USD', # EUR, CAD, GBP, AUD, JPY, ...
32
31
  symbol: '$',
33
32
  delimiter: ',',
@@ -38,6 +37,8 @@ ATTRIBUTE_TYPES = {
38
37
 
39
38
  The field will figure out the appropriate thousand separator and decimal delimiter for the unit.
40
39
 
40
+ ![Demo](https://raw.githubusercontent.com/zooppa/administrate-field-money/master/demo.gif)
41
+
41
42
  ## About
42
43
 
43
44
  Administrate::Field::Money is maintained by [Zooppa].
@@ -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.1.0'
5
+ gem.version = '0.1.1'
6
6
  gem.authors = ['Michele Gerarduzzi']
7
7
  gem.email = ['michele.gerarduzzi@gmail.com']
8
8
  gem.homepage = 'https://github.com/zooppa/administrate-field-money'
@@ -48,6 +48,11 @@ describe Administrate::Field::Money do
48
48
  allow(subject).to receive(:symbol).and_return('€')
49
49
  expect(output).to eq '€1.99'
50
50
  end
51
+
52
+ it 'returns the formatted amount without a symbol' do
53
+ allow(subject).to receive(:symbol).and_return(nil)
54
+ expect(output).to eq '1.99'
55
+ end
51
56
  end
52
57
  end
53
58
 
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michele Gerarduzzi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-06 00:00:00.000000000 Z
11
+ date: 2018-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -95,6 +95,7 @@ extra_rdoc_files: []
95
95
  files:
96
96
  - ".gitignore"
97
97
  - ".rspec"
98
+ - ".ruby-version"
98
99
  - CHANGELOG.md
99
100
  - Gemfile
100
101
  - LICENSE.md
@@ -130,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
131
  version: '0'
131
132
  requirements: []
132
133
  rubyforge_project:
133
- rubygems_version: 2.7.6
134
+ rubygems_version: 2.7.7
134
135
  signing_key:
135
136
  specification_version: 4
136
137
  summary: Money field plugin for Administrate