Class: TagTrash
- Inherits:
-
Object
- Object
- TagTrash
- Includes:
- Ish::Utils, Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/trash/tag_trash.rb
Class Method Summary collapse
- .clear ⇒ Object
-
.list ⇒ Object
the first blank used to be disabled, not anymore vp 20180418.
- .n_features ⇒ Object
- .n_galleries ⇒ Object
-
.n_items ⇒ Object
@deprecated, there will be no reports or galleries in tags.
- .n_reports ⇒ Object
- .n_videos ⇒ Object
- .no_parent ⇒ Object
Methods included from Ish::Utils
Class Method Details
.clear ⇒ Object
38 39 40 41 42 |
# File 'lib/trash/tag_trash.rb', line 38 def self.clear if Rails.env.test? Tag.each { |r| r.remove } end end |
.list ⇒ Object
the first blank used to be disabled, not anymore vp 20180418
49 50 51 52 |
# File 'lib/trash/tag_trash.rb', line 49 def self.list out = Tag.unscoped.order_by( :name => :asc ) return( [['', nil]] + out.map { |item| [ item.name, item.id ] } ) end |
.n_features ⇒ Object
68 69 70 |
# File 'lib/trash/tag_trash.rb', line 68 def self.n_features 4 end |
.n_galleries ⇒ Object
61 62 63 |
# File 'lib/trash/tag_trash.rb', line 61 def self.n_galleries 4 end |
.n_items ⇒ Object
@deprecated, there will be no reports or galleries in tags. There will be only features and newsitems
55 56 57 |
# File 'lib/trash/tag_trash.rb', line 55 def self.n_items 10 end |
.n_reports ⇒ Object
58 59 60 |
# File 'lib/trash/tag_trash.rb', line 58 def self.n_reports 4 end |
.n_videos ⇒ Object
64 65 66 |
# File 'lib/trash/tag_trash.rb', line 64 def self.n_videos 4 end |
.no_parent ⇒ Object
44 45 46 |
# File 'lib/trash/tag_trash.rb', line 44 def self.no_parent Tag.where( :parent_tag_id => nil ) end |