Class: Tag

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/tag.rb

Class Method Summary collapse

Class Method Details

.clearObject


45
46
47
48
49
# File 'lib/tag.rb', line 45

def self.clear
  if Rails.env.test?
    Tag.each { |r| r.remove }
  end
end

.listObject

the first blank used to be disabled, not anymore vp 20180418


56
57
58
59
# File 'lib/tag.rb', line 56

def self.list
  out = Tag.unscoped.order_by( :name => :asc )
  return( [['', nil]] + out.map { |item| [ item.name, item.id ] } )
end

.n_featuresObject

Deprecated.

I don't even know why I have this. Should be simplified into non-being.


76
77
78
# File 'lib/tag.rb', line 76

def self.n_features
  4
end

.n_galleriesObject


68
69
70
# File 'lib/tag.rb', line 68

def self.n_galleries
  4
end

.n_itemsObject

@deprecated, there will be no reports or galleries in tags. There will be only features and newsitems


62
63
64
# File 'lib/tag.rb', line 62

def self.n_items
  10
end

.n_reportsObject


65
66
67
# File 'lib/tag.rb', line 65

def self.n_reports
  4
end

.n_videosObject


71
72
73
# File 'lib/tag.rb', line 71

def self.n_videos
  4
end

.no_parentObject


51
52
53
# File 'lib/tag.rb', line 51

def self.no_parent
  Tag.where( :parent_tag_id => nil )
end