has_contact_number 0.1.2 → 0.2.0

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
  SHA256:
3
- metadata.gz: 0d6f2ceda252bfaa8e201a00dab49eddbbb8d255dce3c0448e75714f88691611
4
- data.tar.gz: e990269f749439e1f459cbe74a234bb78199b6506d7c07bbc49ea568ef7ce652
3
+ metadata.gz: 9bde35d103618e2a5a9a058b2d4c9dd2dbd020c82446bb83aee45e87c8b64be8
4
+ data.tar.gz: a57f42a409cabbc5a932d6507e8e94bb6fcfc712598615c3fe8060317a1cc36f
5
5
  SHA512:
6
- metadata.gz: 0a6bb1066c31d3a32389133c75d452100e432090a29c74e20fa80be6e4d90c4b022e235e2d3313d5f1ce44953ca4709a0cd8ce6a53fcb96a2ca64114f35668df
7
- data.tar.gz: a105044c1d825981af97fbabf8fbe42c4f0cb3d2b11f90176e50e2154a6d6b3613b514ad050845e8c438d1beed3573f0aeaffa773af528dac54a738612f4f8a6
6
+ metadata.gz: 7a3b15a2a9ad9da9d082ade297d9d76f02177d5676579bbb5de9ce16d41da10c7eac1eed7454db92ebd28e73d944a46f9aaa8342b558e68ad4813af1411be2fa
7
+ data.tar.gz: d10f0cdb4ded99a36d89cad0b41ac9f9345706a5ced6d87da3abcd0ee03985d3d2ddcc97d46def2650a5cb2ae942abab2395a7258eaa49c59a2e7e8fac4b66c6
@@ -1,10 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
  module ActionView::Helpers::FormOptionsHelper
3
3
 
4
+ OPTIONS_FOR_ISD_CODES_SELECT = IsoCountryCodes.all.map{ |icc|
5
+ {
6
+ code: icc.calling_code,
7
+ code_to_i: icc.calling_code.delete('+').to_i,
8
+ code_to_db: icc.calling_code.delete('+').rjust(4, '0')
9
+ }
10
+ }
11
+ OPTIONS_FOR_ISD_CODES_SELECT_BY_CODE = OPTIONS_FOR_ISD_CODES_SELECT.uniq.sort_by{|record| record[:code_to_i]}.map do |record|
12
+ [record[:code], record[:code_to_db]]
13
+ end
14
+
4
15
  def options_for_isd_code_select
5
- @isd_code_options ||= IsoCountryCodes.all.map do |record|
6
- [record.calling_code, record.calling_code.delete('+').rjust(4, '0')]
7
- end
16
+ OPTIONS_FOR_ISD_CODES_SELECT_BY_CODE
8
17
  end
9
18
 
10
19
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module HasContactNumber
3
3
 
4
- VERSION = '0.1.2'
4
+ VERSION = '0.2.0'
5
5
 
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_contact_number
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anand Bait
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-05 00:00:00.000000000 Z
11
+ date: 2021-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso_country_codes