Class: Mingle::Hashtag

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/mingle/hashtag.rb

Instance Method Summary collapse

Instance Method Details

#tag_name_with_hashObject



16
17
18
19
20
# File 'app/models/mingle/hashtag.rb', line 16

def tag_name_with_hash
  return tag_name if tag_name.start_with? "#"

  "##{tag_name}"
end

#tag_name_without_hashObject



22
23
24
25
26
# File 'app/models/mingle/hashtag.rb', line 22

def tag_name_without_hash
  return tag_name unless tag_name.start_with? "#"

  tag_name[1..-1]
end

#usage_countObject



28
29
30
# File 'app/models/mingle/hashtag.rb', line 28

def usage_count
  hashtaggings.count
end