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 +4 -4
- data/lib/has_contact_number/helper_methods.rb +12 -3
- data/lib/has_contact_number/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bde35d103618e2a5a9a058b2d4c9dd2dbd020c82446bb83aee45e87c8b64be8
|
4
|
+
data.tar.gz: a57f42a409cabbc5a932d6507e8e94bb6fcfc712598615c3fe8060317a1cc36f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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.
|
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-
|
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
|