Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid resetting tags when posts are published via trigger.
  • Loading branch information
Flameeyes committed Mar 1, 2013
1 parent 48b69ad commit 7eeeac7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/article.rb
Expand Up @@ -243,6 +243,11 @@ def self.search(query, args={})
end

def keywords_to_tags
# if keywords is empty, we want to reset the tags altogether, but
# if they do not exists (for instance because we're triggered by a
# publication_pending) we don't want to destroy the tags
return if keywords.nil?

Article.transaction do
tags.clear
tags <<
Expand Down

0 comments on commit 7eeeac7

Please sign in to comment.