diff --git a/lib/haml/filters/growstuff_markdown.rb b/lib/haml/filters/growstuff_markdown.rb index 78f481161..fc3e2fbbb 100644 --- a/lib/haml/filters/growstuff_markdown.rb +++ b/lib/haml/filters/growstuff_markdown.rb @@ -13,7 +13,7 @@ module Haml::Filters # turn [tomato](crop) into [tomato](http://growstuff.org/crops/tomato) return orig.gsub(/\[(.*?)\]\(crop\)/) do |m| crop_str = $1 - crop = Crop.find_by_system_name(crop_str) + crop = Crop.find_by_name(crop_str) if crop url = url_for(crop_path(crop)) "[#{crop_str}](#{url})" diff --git a/spec/lib/haml/filters/growstuff_markdown_spec.rb b/spec/lib/haml/filters/growstuff_markdown_spec.rb index 73f4161ba..dd435e0c0 100644 --- a/spec/lib/haml/filters/growstuff_markdown_spec.rb +++ b/spec/lib/haml/filters/growstuff_markdown_spec.rb @@ -8,7 +8,7 @@ def input_link(name) end def output_link(crop) - return "[#{crop.system_name}](#{crop_path(crop)})" + return "[#{crop.name}](#{crop_path(crop)})" end describe 'Haml::Filters::Growstuff_Markdown' do @@ -19,7 +19,7 @@ describe 'Haml::Filters::Growstuff_Markdown' do it 'converts quick crop links' do @crop = FactoryGirl.create(:crop) - rendered = Haml::Filters::GrowstuffMarkdown.render(input_link(@crop.system_name)) + rendered = Haml::Filters::GrowstuffMarkdown.render(input_link(@crop.name)) rendered.should eq output_link(@crop) end