forgeplus/app/models/attachment_group_setting.rb

28 lines
843 B
Ruby
Raw Normal View History

2020-11-23 15:35:03 +08:00
# == Schema Information
#
# Table name: attachment_group_settings
#
# id :integer not null, primary key
# attachment_id :integer
# course_group_id :integer
# course_id :integer
# publish_time :datetime
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_attachment_group_settings_on_attachment_id (attachment_id)
# index_attachment_group_settings_on_course_group_id (course_group_id)
# index_attachment_group_settings_on_course_id (course_id)
#
2020-03-09 00:40:16 +08:00
class AttachmentGroupSetting < ActiveRecord::Base
belongs_to :attachment
2020-04-23 11:08:29 +08:00
# belongs_to :course_group
# belongs_to :course
2020-03-09 00:40:16 +08:00
scope :none_published, -> {where("attachment_group_settings.publish_time IS NULL OR attachment_group_settings.publish_time > ?", Time.now)}
end