app/models/tag.rb
# Returns similar tags if found or nil
# @return [formated String] Similar tags
# @return [nil] no match
Returns similar tags if found or nil
Returns similar tags if found or nil
def find_similar
    seed_data.each do |tag, candidates|
      candidates.each do |candidate|
        return "Maybe the tag #{name} is wrong. Did you mean #{tag}?" if name.match(/#{candidate}/) && name != tag
      end
    end
    nil
  end
def find_similar seed_data . each do | tag , candidates | candidates . each do | candidate | return "Maybe the tag #{name} is wrong. Did you mean #{tag}?" if name . match ( / #{ candidate } / ) && name != tag end end nil end
Returns similar tags if found or nil
Returns similar tags if found or nil
None
formated String
None
nil