|
|
|
@ -22,8 +22,8 @@ class Subject < ApplicationRecord
|
|
|
|
|
has_many :courses, -> { where("is_delete = 0").order("courses.created_at ASC") }
|
|
|
|
|
|
|
|
|
|
validates :name, length: { maximum: 60 }
|
|
|
|
|
validates :description, length: { maximum: 5000 }
|
|
|
|
|
validates :learning_notes, length: { maximum: 500 }
|
|
|
|
|
validates :description, length: { maximum: 8000 }
|
|
|
|
|
validates :learning_notes, length: { maximum: 2000 }
|
|
|
|
|
|
|
|
|
|
scope :visible, lambda{where(status: 2)}
|
|
|
|
|
scope :published, lambda{where(status: 1)}
|
|
|
|
|