Sha256: 321cb25c46eb32c83b5dc41ad6af7637299e15a5f198476e351da4437a62ebf4

Contents?: true

Size: 385 Bytes

Versions: 4

Compression:

Stored size: 385 Bytes

Contents

class Video < ActiveRecord::Base
  unloadable

  has_friendly_id :title, :use_slug => true

  belongs_to :user
  belongs_to :project
  belongs_to :version

  def length
    return "0:00" if duration.blank?
    minutes = duration / 60
    seconds = duration % 60
    "#{minutes}:#{seconds.to_s.rjust(2,'0')}"
  end

  def permalink
    friendly_id
  end

  def to_s
    title
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chili_videos-0.2.2 app/models/video.rb
chili_videos-0.2.1 app/models/video.rb
chili_videos-0.2.0 app/models/video.rb
chili_videos-0.1.0 app/models/video.rb