Class: Video

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Sinatra::Videoman
Defined in:
lib/sinatra/videoman/models/video.rb

Constant Summary

Constants included from Sinatra::Videoman

Sinatra::Videoman::VERSION

Instance Method Summary collapse

Instance Method Details

#file_sizeObject



18
19
20
21
22
# File 'lib/sinatra/videoman/models/video.rb', line 18

def file_size
  if thumbnail.file && (thumbnail.file.size.to_f / 2**20).round(2) > Manager.config[:max_video_file_size]
    errors.add(:thumbnail, "You cannot upload a file greater than #{Manager.config[:max_video_file_size]}MB")
  end
end