|
|
|
@ -24,6 +24,7 @@ class Attachment < ApplicationRecord
|
|
|
|
|
scope :simple_columns, -> { select(:id, :filename, :filesize, :created_on, :cloud_url, :author_id, :content_type, :container_type, :container_id) }
|
|
|
|
|
scope :search_by_container, -> (ids) {where(container_id: ids)}
|
|
|
|
|
scope :unified_setting, -> {where("unified_setting = ? ", 1)}
|
|
|
|
|
scope :published, -> {where(is_publish: 1)}
|
|
|
|
|
|
|
|
|
|
validates_length_of :description, maximum: 100, message: "不能超过100个字符"
|
|
|
|
|
|
|
|
|
|