Class: Gemgento::Tag

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/gemgento/tag.rb

Overview

Author:

  • Gemgento LLC

Instance Method Summary collapse

Instance Method Details

#base_popularity(store = nil) ⇒ Integer

Get the tag base popularity for a store.

Parameters:

  • store (Store, nil) (defaults to: nil)

Returns:

  • (Integer)


19
20
21
# File 'app/models/gemgento/tag.rb', line 19

def base_popularity(store = nil)
  self.store_tags.find_by(store: (store || self.stores.first)).base_popularity
end