title: How to find trending hashtags based on use case in Ruby on Rails
body: <p>At first, that is my schema file</p>
  
  <pre><code>create_table "events", force: :cascade do |t|
    t.string "title"
    t.text "description"
    t.string "location"
    t.integer "user_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["user_id"], name: "index_events_on_user_id"
  end
  
  create_table "events_hash_tags", id: false, force: :cascade do |t|
    t.integer "event_id"
    t.integer "hash_tag_id"
    t.index ["event_id"], name: "index_events_hash_tags_on_event_id"
    t.index ["hash_tag_id"], name: "index_events_hash_tags_on_hash_tag_id"
  end
  
  create_table "hash_tags", force: :cascade do |t|
    t.string "name"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end
  </code></pre>
  
  <p><code>hashtags</code> creating successfully in <code>hash_tags</code> table and creating the association with <code>events_hash_tags</code>.</p>
  
  <p>I want to know how to find the trending <code>hashtags</code> based on use cases like if 10 hashtags on <code>hash_tags</code> table then how to find which <code>hashtag</code> used in most events if one <code>hashtag</code> used in 10 events and that is maximum then how to find that programmatically.</p>
  
  <p>My question is how to find 5 trending <code>hashtags</code> which used maximum time of events.</p>
  
  <p>Perdon if I did not explain well.</p>
  
  <p>Thanks </p>