Class: Mingle::Hashtag
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Mingle::Hashtag
- Defined in:
- app/models/mingle/hashtag.rb
Instance Method Summary collapse
Instance Method Details
#tag_name_with_hash ⇒ Object
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_hash ⇒ Object
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_count ⇒ Object
28 29 30 |
# File 'app/models/mingle/hashtag.rb', line 28 def usage_count hashtaggings.count end |