Class: Video

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

Constant Summary collapse

PER_PAGE =
6

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.listObject


34
35
36
# File 'lib/video.rb', line 34

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

#is_premiumObject


82
83
84
# File 'lib/video.rb', line 82

def is_premium
  premium_tier > 0
end

#premium?Boolean

Returns:

  • (Boolean)

85
# File 'lib/video.rb', line 85

def premium?; is_premium; end

#premium_tierObject

copy-paste


81
# File 'lib/video.rb', line 81

field :premium_tier, type: Integer, default: 0