Class: Video
Constant Summary
collapse
- PER_PAGE =
6
Mongoid::Votable::VOTE_POINT
Class Method Summary
collapse
Instance Method Summary
collapse
#down_voter_ids, #down_votes_count, #up_voter_ids, #up_votes_count, #vote, #vote_value, #votes_count, #votes_point
Methods included from Ish::Utils
#export
included, #is_premium
Class Method Details
.list ⇒ Object
53
54
55
|
# File 'lib/video.rb', line 53
def self.list
[['', nil]] + Video.unscoped.order_by( :created_at => :desc ).map { |item| [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ] }
end
|
Instance Method Details
#export_fields ⇒ Object
87
88
89
|
# File 'lib/video.rb', line 87
def export_fields
%w| name descr |
end
|
#is_trash ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/video.rb', line 23
def is_trash
if deleted_at
true
else
self[:is_trash]
end
end
|
#published ⇒ Object
33
34
35
|
# File 'lib/video.rb', line 33
def published
where({ :is_public => true, :is_trash => false }).order_by({ :created_at => :desc })
end
|
#subhead ⇒ Object
still need it… 2023-03-24
20
|
# File 'lib/video.rb', line 20
field :subhead
|