i18n_country_select 1.0.19 → 1.1.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
  SHA1:
3
- metadata.gz: 3ecf6fe042b23e81a270af77cc1f5b9ba3cf83f9
4
- data.tar.gz: ff617925f6467a7eef8b96b883e47c6df38e24cb
3
+ metadata.gz: 4e34e99a3b26cc00853cbf5d5dcd5c740c038a0c
4
+ data.tar.gz: 6612498e32156e8f87c16db1e877a255d1a00fdf
5
5
  SHA512:
6
- metadata.gz: a8a3468e27669bf02cc847b4ee0cefdde15b45b6fa5447ad9cfa5434245707f84e45608db9a465f5658b77e898e9388167379645dcda34166854d37a6985ad45
7
- data.tar.gz: 0b06fe56c1ca328995ad3d70ec4f61503d82cfb31c85314fbecf83529de2389a4a15a278db65df14a07de47809d6828892112d986dd78680fd3d25bcba84d7da
6
+ metadata.gz: 33c79b176d6ce5f8aca40fc0fcc6b0081abcebbc466e28f45d9b10270cea46824627af1236a5b8ede346e7757bd4130cc7b18403a7e39047482886c2352a5c20
7
+ data.tar.gz: 19b4aee5c9102c2cb280314e6fc5ab4ca0cc1e6d52e530ff00367288a488eeafbc21782075a260dc96f984b546dbd9eac4b79fc9258fbfe8fd3fb447fb3d0fe5
@@ -36,10 +36,12 @@ Supplying priority countries to be placed at the top of the list:
36
36
  * Marten Klitzke (https://github.com/mortik)
37
37
  * Victor D. (https://github.com/V1c70r)
38
38
  * Alexey Degtyarev (https://github.com/alexhifer)
39
+ * Björn Wilmsmann (https://github.com/BjoernKW)
39
40
 
40
41
  Based on the deprecated country_code_select by: Russ Smith (russ@bashme.org) and Frank Wambutt (frank@mo-stud.io)
41
42
 
42
43
  == Version History
44
+ * 1.1.0 - Rails 4 support
43
45
  * 1.0.19 - Added Macedonia
44
46
  * 1.0.18 - Fixed translated sorting
45
47
  * 1.0.17 - Removing duplicate country code IE
@@ -8,5 +8,9 @@ require "i18n_country_select/form_helpers"
8
8
  require "i18n_country_select/instance_tag"
9
9
 
10
10
  ActionView::Base.send(:include, I18nCountrySelect::FormHelpers)
11
- ActionView::Helpers::InstanceTag.send(:include, I18nCountrySelect::InstanceTag)
11
+ if Rails::VERSION::MAJOR >= 4
12
+ ActionView::Helpers::ActiveModelInstanceTag.send(:include, I18nCountrySelect::InstanceTag)
13
+ else
14
+ ActionView::Helpers::InstanceTag.send(:include, I18nCountrySelect::InstanceTag)
15
+ end
12
16
  ActionView::Helpers::FormBuilder.send(:include, I18nCountrySelect::FormBuilder)
@@ -1,7 +1,13 @@
1
1
  module I18nCountrySelect
2
2
  module FormHelpers
3
3
  def country_code_select(object_name, method, priority_countries = nil, options = {}, html_options = {})
4
- ActionView::Helpers::InstanceTag.new(object_name, method, self, options.delete(:object)).to_country_code_select_tag(priority_countries, options, html_options)
4
+ if Rails::VERSION::MAJOR >= 4
5
+ instance_tag = ActionView::Helpers::Tags::Select.new(object_name, method, self, [], options, html_options)
6
+ return instance_tag.to_country_code_select_tag(priority_countries, options.delete(:object), html_options)
7
+ else
8
+ instance_tag = ActionView::Helpers::InstanceTag.new(object_name, method, self, options.delete(:object))
9
+ return instance_tag.to_country_code_select_tag(priority_countries, options, html_options)
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -19,7 +19,7 @@ module I18nCountrySelect
19
19
 
20
20
  countries = ""
21
21
 
22
- if options[:include_blank]
22
+ if options.present? and options[:include_blank]
23
23
  option = options[:include_blank] == true ? "" : options[:include_blank]
24
24
  countries += "<option>#{option}</option>\n"
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module I18nCountrySelect
2
- VERSION = "1.0.19"
2
+ VERSION = "1.1.0"
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.0.19
4
+ version: 1.1.0
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: 2013-10-30 00:00:00.000000000 Z
11
+ date: 2013-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n