hps_learning/app/models/hps_lecture.rb

18 lines
562 B
Ruby
Raw Permalink Normal View History

2017-07-04 16:58:50 +00:00
class HpsLecture
include Mongoid::Document
include Mongoid::Timestamps
mount_uploader :lecture_pic, ImageUploader
field :subject, :localize => true
field :presenter, :localize => true
field :runtime_hours, type: Integer, default: 0
field :runtime_mins, type: Integer, default: 0
belongs_to :hps_class
has_one :hps_lecture_file, :autosave => true, :dependent => :destroy
def get_runtime
return self.runtime_hours.to_s + " " + I18n.t("hps_learning.hours") + " " + self.runtime_mins.to_s + " " + I18n.t("hps_learning.minutes")
end
end