aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/helpers/public_body_helper.rb7
-rw-r--r--config/initializers/alaveteli.rb2
-rw-r--r--spec/helpers/public_body_helper_spec.rb2
3 files changed, 6 insertions, 5 deletions
diff --git a/app/helpers/public_body_helper.rb b/app/helpers/public_body_helper.rb
index 332e93284..57c90a9ba 100644
--- a/app/helpers/public_body_helper.rb
+++ b/app/helpers/public_body_helper.rb
@@ -38,12 +38,13 @@ module PublicBodyHelper
#
# Returns a string
def type_of_authority(public_body)
- types = public_body.tags.each_with_index.map do |tag, index|
+ first = true
+ types = public_body.tags.each.map do |tag|
if PublicBodyCategory.get().by_tag().include?(tag.name)
desc = PublicBodyCategory.get().singular_by_tag()[tag.name]
-
- if index.zero?
+ if first
desc = desc.sub(/\S/) { |m| Unicode.upcase(m) }
+ first = false
end
link_to(desc, list_public_bodies_path(tag.name))
end
diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb
index 775c9ec5b..7465a5ca1 100644
--- a/config/initializers/alaveteli.rb
+++ b/config/initializers/alaveteli.rb
@@ -10,7 +10,7 @@ load "debug_helpers.rb"
load "util.rb"
# Application version
-ALAVETELI_VERSION = '0.21.0.5'
+ALAVETELI_VERSION = '0.21.0.6'
# Add new inflection rules using the following format
# (all these examples are active by default):
diff --git a/spec/helpers/public_body_helper_spec.rb b/spec/helpers/public_body_helper_spec.rb
index 0bf55abb4..d4f3acf78 100644
--- a/spec/helpers/public_body_helper_spec.rb
+++ b/spec/helpers/public_body_helper_spec.rb
@@ -74,7 +74,7 @@ describe PublicBodyHelper do
:description => "spec category #{i}")
heading.add_category(category)
end
- public_body = FactoryGirl.create(:public_body, :tag_string => 'spec_0 spec_2 unknown')
+ public_body = FactoryGirl.create(:public_body, :tag_string => 'unknown spec_0 spec_2')
expected = '<a href="/body/list/spec_0">Spec category 0</a> and <a href="/body/list/spec_2">spec category 2</a>'
expect(type_of_authority(public_body)).to eq(expected)
end