Skip to content

Commit

Permalink
addressing a bug in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfrench committed May 11, 2009
1 parent 8239478 commit 004e1c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/formtastic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,10 @@ def country_input(method, options)
raise "To use the :country input, please install a country_select plugin, like this one: http://github.com/rails/iso-3166-country-select" unless self.respond_to?(:country_select)

html_options = options.delete(:input_html) || {}
priority_countries = options.delete(:priority_countries) || @@priority_countries

self.label(method, options.slice(:label, :required)) +
self.country_select(method, options.delete(:priority_countries), set_options(options), html_options)
self.country_select(method, priority_countries, set_options(options), html_options)
end


Expand Down
2 changes: 1 addition & 1 deletion spec/formtastic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ def custom(arg1, arg2, options = {})
builder.stub!(:country_select).and_return("<select><option>...</option></select>")
builder.should_receive(:country_select).with(:country, priority_countries, {}, {}).and_return("<select><option>...</option></select>")

concat(builder.input(:country, :as => :country, :priority_countries => priority_countries))
concat(builder.input(:country, :as => :country))
end
end

Expand Down

0 comments on commit 004e1c0

Please sign in to comment.