Skip to content

Commit

Permalink
Updated country_select syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
elektronaut committed Mar 11, 2024
1 parent c570ea6 commit 6872b22
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PATH
acts_as_list (~> 0.9)
alba (~> 1.3.0)
bcrypt
country_select
country_select (>= 9.0.0)
dis (~> 1.1.2)
dynamic_image (>= 2.0)
jbuilder (~> 2.5)
Expand Down
9 changes: 2 additions & 7 deletions app/helpers/pages_core/labelled_form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,10 @@ def labelled_check_box(
end

def labelled_country_select(
attr, label = nil, priority = {}, opts = {}, html_opts = {}
attr, label = nil, opts = {}, html_opts = {}
)
if priority.is_a?(Hash)
return labelled_field(attr, label, priority) do |options|
country_select(attr, options, opts, html_opts)
end
end
labelled_field(attr, label, opts) do |options|
country_select(attr, priority, options, html_opts)
country_select(attr, options, html_opts)
end
end

Expand Down
2 changes: 1 addition & 1 deletion pages_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Gem::Specification.new do |s|
s.add_dependency "actionpack-page_caching", ">= 1.1.0"
s.add_dependency "alba", "~> 1.3.0"
s.add_dependency "bcrypt"
s.add_dependency "country_select"
s.add_dependency "country_select", ">= 9.0.0"
s.add_dependency "dis", "~> 1.1.2"
s.add_dependency "dynamic_image", ">= 2.0"
s.add_dependency "lograge", "~> 0.11.2"
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/pages_core/form_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
allow(builder).to receive(:country_select)
builder.labelled_country_select(:email)
expect(builder).to have_received(:country_select)
.with(:email, {}, {}, {})
.with(:email, {}, {})
end
end

Expand Down

0 comments on commit 6872b22

Please sign in to comment.