i18n_country_select 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99c80dcbe9bf2130f1b09b3fb4408c4d9866bc5c
4
- data.tar.gz: 63c54c634b5fc320032776936fbbf59c5488bc9f
3
+ metadata.gz: d2999baf776b6f61079d920bcef517c3b523f689
4
+ data.tar.gz: 59ca5160ee2e5e85cf3ca3046b896f897579ef9a
5
5
  SHA512:
6
- metadata.gz: c25106cf5ff9246de4c22b2e8e0dc0b622069155889ffc6fc013b3e420d6453422ad41afd3ead868486d6791c04b4fb4dd793a313217feb4cb29cd8b0b5d3e0d
7
- data.tar.gz: cf576b1f6770191ecd65978d18f9867bef6f91e43ea44c6dfc338bd5e48eb4782bdfbb01005d740c882530dd98733d6a21a90be3c8d726c556e22d29db8f3a39
6
+ metadata.gz: f75db348f2c8c9809725b037dd743379cfef62a32db1635d8046031f36e763ebb4fea1cdf3cf0a0bc6adca8143c37f3f8a66123206bc02aa08dd739ae3097662
7
+ data.tar.gz: fd3266b50babc2a0c6cba07274313785e62321b144111e66bbac8dce192f503eb0ba60200597bc17cd8fe013ce52d5534f823a266dd8828e4dcabbfff117b6d0
@@ -26,6 +26,10 @@ Supplying priority countries to be placed at the top of the list:
26
26
 
27
27
  country_code_select(:user, :country, [[ 'US', 'United States' ], [ 'CA', 'Canada' ]])
28
28
 
29
+ Specifying different selected value:
30
+
31
+ country_code_select(:user, :country, [], selected: 'CA')
32
+
29
33
 
30
34
  == Contributors
31
35
 
@@ -47,10 +51,12 @@ Supplying priority countries to be placed at the top of the list:
47
51
  * Adam St. John (https://github.com/astjohn)
48
52
  * Monica Giambitto - https://github.com/nirnaeth
49
53
  * Marat Galiev - https://github.com/maratgaliev
54
+ * Rachel Carvalho - https://github.com/rachel-carvalho
50
55
 
51
56
  Based on the deprecated country_code_select by: Russ Smith (russ@bashme.org) and Frank Wambutt (frank@mo-stud.io)
52
57
 
53
58
  == Version History
59
+ * 1.1.7 - Adding support for default selection
54
60
  * 1.1.6 - Simplifying country code definition
55
61
  * 1.1.5 - Fixing support for Rails 4.2. Adding Kosovo country code
56
62
  * 1.1.4 - Fixed options being ignored when running Rails 4
@@ -10,7 +10,7 @@ module I18nCountrySelect
10
10
 
11
11
  # Adapted from Rails country_select. Just uses country codes instead of full names.
12
12
  def country_code_select(priority_countries, options, html_options)
13
- selected = object.send(@method_name) if object.respond_to?(@method_name)
13
+ selected = options.fetch(:selected, object.respond_to?(@method_name) ? object.send(@method_name) : nil)
14
14
 
15
15
  countries = ""
16
16
 
@@ -1,3 +1,3 @@
1
1
  module I18nCountrySelect
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_country_select
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian McQuay (brian@onomojo.com)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-13 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n