Skip to content

Commit

Permalink
made to_url_key handle html entities
Browse files Browse the repository at this point in the history
  • Loading branch information
ethn committed Nov 2, 2010
1 parent 60ed551 commit b9c63f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions config/wagn_initializer.rb
Expand Up @@ -107,9 +107,7 @@ def setup_multihost
System.wagn_name = mapping.wagn_name
end
ActiveRecord::Base.connection.schema_search_path = ENV['WAGN']
if Card.cache
Card.cache.system_prefix = Wagn::Cache.system_prefix
end
#Card.cache.system_prefix = Wagn::Cache.system_prefix
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/cardname.rb
Expand Up @@ -79,7 +79,7 @@ def junction?
end

def to_url_key
gsub(/[^\*\w\s\+]/,' ').strip.gsub(/[\s\_]+/,'_')
decode_html.gsub(/[^\*\w\s\+]/,' ').strip.gsub(/[\s\_]+/,'_')
end

def to_key
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/cardname_spec.rb
Expand Up @@ -113,7 +113,7 @@


describe "#to_url_key" do
cardnames = ["GrassCommons.org", 'Oh you @##', "Alice's Restaurant!"]
cardnames = ["GrassCommons.org", 'Oh you @##', "Alice's Restaurant!", "PB & J", "Mañana"]

cardnames.each do |name|
it "should have the same key as the name" do
Expand Down

0 comments on commit b9c63f5

Please sign in to comment.