Class: Wco::Video

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Paperclip, Mongoid::Paranoia, Mongoid::Timestamps, Utils
Defined in:
app/models/wco/video.rb

Constant Summary collapse

PAGE_PARAM_NAME =
'videos_page'

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

#export, included

Class Method Details

.listObject



76
77
78
79
80
# File 'app/models/wco/video.rb', line 76

def self.list
  [['', nil]] + self.unscoped.order_by( :created_at => :desc ).map do |item|
    [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ]
  end
end

Instance Method Details

#export_fieldsObject



72
73
74
# File 'app/models/wco/video.rb', line 72

def export_fields
  %w| name descr |
end

#publishedObject



22
23
24
# File 'app/models/wco/video.rb', line 22

def published
  where({ :is_public => true }).order_by({ :created_at => :desc })
end

#subheadObject

still need it… 2023-03-24



19
# File 'app/models/wco/video.rb', line 19

field :subhead