coins_paid_rails 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/coins_paid_rails.gemspec +1 -1
- data/lib/coins_paid.rb +4 -0
- data/spec/issued_addresses_spec.rb +20 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25025c942a4c630da89e160486f2c5d1f05ed9584ce7f2c4fa27d4bf54c738f3
|
4
|
+
data.tar.gz: 5d8394faae19349b459dbd31e3277f047eda74eaaa67c9b632649100244170e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f53a2431352a34504e6cca780e8a29b3492418ea7112ccfb647139f33e211cf98194e5964a37f837cc856a711db0f1f172bf878fbba7b5b6265ae3f4a610144a
|
7
|
+
data.tar.gz: 49ef1f19b5924e1b2ffbc1c0ae485d3c185a8fa91796e676b7fdf07429e1d472a4770d253014e5c023ad3e12681d5969e10a8a6e0b8fb1abd24bc17e92a56b6d
|
data/Gemfile.lock
CHANGED
data/coins_paid_rails.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'coins_paid_rails'
|
3
3
|
s.authors = ['Artem Biserov(artembiserov)', 'Oleg Ivanov(morhekil)']
|
4
|
-
s.version = '1.1.
|
4
|
+
s.version = '1.1.7'
|
5
5
|
s.files = `git ls-files`.split("\n")
|
6
6
|
s.summary = 'CoinsPaid Rails Integration'
|
7
7
|
s.license = 'MIT'
|
data/lib/coins_paid.rb
CHANGED
@@ -36,4 +36,8 @@ module CoinsPaid
|
|
36
36
|
def currency(name)
|
37
37
|
CoinsPaid::API.currencies_list.find { |item| item.currency == name } || raise(UnknownCurrency, name)
|
38
38
|
end
|
39
|
+
|
40
|
+
def issued_addresses(foreign_id)
|
41
|
+
CoinsPaidAddress.where(foreign_id: foreign_id).order(:currency)
|
42
|
+
end
|
39
43
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
describe CoinsPaid, '.issued_addresses' do
|
4
|
+
let(:foreign_id) { 123 }
|
5
|
+
|
6
|
+
it 'returns addresses with requested foreign_id ordered by currency' do
|
7
|
+
attrs = {
|
8
|
+
foreign_id: foreign_id,
|
9
|
+
currency: 'BTC',
|
10
|
+
address: 'addr',
|
11
|
+
external_id: 1
|
12
|
+
}
|
13
|
+
|
14
|
+
addr1 = CoinsPaid::CoinsPaidAddress.create!(attrs)
|
15
|
+
addr2 = CoinsPaid::CoinsPaidAddress.create!(attrs.merge(currency: 'ETH'))
|
16
|
+
CoinsPaid::CoinsPaidAddress.create!(attrs.merge(foreign_id: 555))
|
17
|
+
|
18
|
+
expect(CoinsPaid.issued_addresses(foreign_id)).to eq [addr1, addr2]
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coins_paid_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Biserov(artembiserov)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-09-
|
12
|
+
date: 2021-09-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: coins_paid_api
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- lib/generators/coins_paid/templates/migration.rb
|
105
105
|
- spec/address_spec.rb
|
106
106
|
- spec/currency_spec.rb
|
107
|
+
- spec/issued_addresses_spec.rb
|
107
108
|
- spec/qr_code_spec.rb
|
108
109
|
- spec/spec_helper.rb
|
109
110
|
- spec/support/database/create_table.rb
|