Skip to content

Commit ac2cb88

Browse files
committed
Remove space as a delimiter for tags
Space is no longer used as a delimiter anywhere in the codebase. Updated specs. minor fixes
1 parent 033c015 commit ac2cb88

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

app/controllers/protips_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def feature
316316
end
317317
318318
def delete_tag
319-
@protip.topic_list.remove(CGI.unescape(params.permit(:topic)))
319+
@protip.topic_list.remove(params.permit(:topic))
320320
respond_to do |format|
321321
if @protip.save
322322
format.html { redirect_to protip_path(@protip) }

app/models/network.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Network < ActiveRecord::Base
1717
profile_url: { type: 'string', index: 'not_analyzed' },
1818
} } } }
1919

20-
acts_as_taggable_on :tags
20+
acts_as_taggable
2121
acts_as_followable
2222
attr_accessor :resident_expert
2323
has_many :network_experts, autosave: true, dependent: :destroy

app/models/opportunity.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Opportunity < ActiveRecord::Base
66
include SearchModule
77
include OpportunityMapping
88

9-
acts_as_taggable_on :tags
9+
acts_as_taggable
1010

1111
OPPORTUNITY_TYPES = %w(full-time part-time contract internship)
1212

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
# Replace this with default parser before upgrading to AATO 4.0+
2-
ActsAsTaggableOn.delimiter = [' ', ',']
31
ActsAsTaggableOn.force_lowercase = true

spec/fabricators/opportunity_fabricator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
salary 100_000
33
name 'Senior Rails Web Developer'
44
description 'Architect and implement the Ruby and Javascript underpinnings of our various user-facing and internal web apps like api.heroku.com.'
5-
tag_list ['rails', 'sinatra', 'JQuery', 'Clean, beautiful code']
5+
tag_list ['rails', 'sinatra', 'JQuery']
66
location 'San Francisco, CA'
77
cached_tags 'java, python'
88
team_id { Fabricate(:team, paid_job_posts: 1).id }

spec/models/protip_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@
120120
expect(protip.topics.count).to eq(1)
121121
end
122122

123-
it 'should accept tags separated by spaces only' do
124-
protip = Fabricate(:protip, topic_list: 'ruby python heroku', user: Fabricate(:user))
123+
it 'should accept tags separated by commas only' do
124+
protip = Fabricate(:protip, topic_list: 'ruby, python, heroku', user: Fabricate(:user))
125125
protip.save!
126126
expect(protip.topic_list).to eq(%w(ruby python heroku))
127127
expect(protip.topics.count).to eq(3)
128128
end
129129

130130
it '#topic_ids should return ids of topics only' do
131-
protip = Fabricate(:protip, topic_list: 'ruby python', user: Fabricate(:user))
131+
protip = Fabricate(:protip, topic_list: 'ruby, python', user: Fabricate(:user))
132132
protip.save!
133133
ruby_id = Tag.find_by_name("ruby").id
134134
python_id = Tag.find_by_name("python").id

0 commit comments

Comments
 (0)