Class: Tag
- Inherits:
-
Object
- Object
- Tag
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/tag.rb
Class Method Summary collapse
- .clear ⇒ Object
-
.list ⇒ Object
the first blank used to be disabled, not anymore vp 20180418.
-
.n_features ⇒ Object
deprecated
Deprecated.
I don’t even know why I have this. Should be simplified into non-being.
- .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
Class Method Details
.clear ⇒ Object
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 |
.list ⇒ Object
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_features ⇒ Object
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_galleries ⇒ Object
68 69 70 |
# File 'lib/tag.rb', line 68 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
62 63 64 |
# File 'lib/tag.rb', line 62 def self.n_items 10 end |
.n_reports ⇒ Object
65 66 67 |
# File 'lib/tag.rb', line 65 def self.n_reports 4 end |
.n_videos ⇒ Object
71 72 73 |
# File 'lib/tag.rb', line 71 def self.n_videos 4 end |
.no_parent ⇒ Object
51 52 53 |
# File 'lib/tag.rb', line 51 def self.no_parent Tag.where( :parent_tag_id => nil ) end |