Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop
This commit is contained in:
commit
99fd459bd6
|
@ -1,45 +1,45 @@
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: attachments
|
# Table name: attachments
|
||||||
#
|
#
|
||||||
# id :integer not null, primary key
|
# id :integer not null, primary key
|
||||||
# container_id :integer
|
# container_id :integer
|
||||||
# container_type :string(30)
|
# container_type :string(30)
|
||||||
# filename :string(255) default(""), not null
|
# filename :string(255) default(""), not null
|
||||||
# disk_filename :string(255) default(""), not null
|
# disk_filename :string(255) default(""), not null
|
||||||
# filesize :integer default("0"), not null
|
# filesize :integer default("0"), not null
|
||||||
# content_type :string(255) default("")
|
# content_type :string(255) default("")
|
||||||
# digest :string(60) default(""), not null
|
# digest :string(60) default(""), not null
|
||||||
# downloads :integer default("0"), not null
|
# downloads :integer default("0"), not null
|
||||||
# author_id :integer default("0"), not null
|
# author_id :integer default("0"), not null
|
||||||
# created_on :datetime
|
# created_on :datetime
|
||||||
# description :text(65535)
|
# description :text(65535)
|
||||||
# disk_directory :string(255)
|
# disk_directory :string(255)
|
||||||
# attachtype :integer default("1")
|
# attachtype :integer default("1")
|
||||||
# is_public :integer default("1")
|
# is_public :integer default("1")
|
||||||
# copy_from :integer
|
# copy_from :integer
|
||||||
# quotes :integer default("0")
|
# quotes :integer default("0")
|
||||||
# is_publish :integer default("1")
|
# is_publish :integer default("1")
|
||||||
# publish_time :datetime
|
# publish_time :datetime
|
||||||
# resource_bank_id :integer
|
# resource_bank_id :integer
|
||||||
# unified_setting :boolean default("1")
|
# unified_setting :boolean default("1")
|
||||||
# cloud_url :string(255) default("")
|
# cloud_url :string(255) default("")
|
||||||
# course_second_category_id :integer default("0")
|
# course_second_category_id :integer default("0")
|
||||||
# delay_publish :boolean default("0")
|
# delay_publish :boolean default("0")
|
||||||
# memo_image :boolean default("0")
|
# memo_image :boolean default("0")
|
||||||
# extra_type :integer default("0")
|
# extra_type :integer default("0")
|
||||||
# uuid :string(255)
|
# uuid :string(255)
|
||||||
#
|
#
|
||||||
# Indexes
|
# Indexes
|
||||||
#
|
#
|
||||||
# index_attachments_on_author_id (author_id)
|
# index_attachments_on_author_id (author_id)
|
||||||
# index_attachments_on_container_id_and_container_type (container_id,container_type)
|
# index_attachments_on_container_id_and_container_type (container_id,container_type)
|
||||||
# index_attachments_on_course_second_category_id (course_second_category_id)
|
# index_attachments_on_course_second_category_id (course_second_category_id)
|
||||||
# index_attachments_on_created_on (created_on)
|
# index_attachments_on_created_on (created_on)
|
||||||
# index_attachments_on_is_public (is_public)
|
# index_attachments_on_is_public (is_public)
|
||||||
# index_attachments_on_quotes (quotes)
|
# index_attachments_on_quotes (quotes)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ class Attachment < ApplicationRecord
|
||||||
scope :unified_setting, -> {where("unified_setting = ? ", 1)}
|
scope :unified_setting, -> {where("unified_setting = ? ", 1)}
|
||||||
scope :where_id_or_uuid, -> (id) { (Float(id) rescue nil).present? ? where(id: id) : where(uuid: id) }
|
scope :where_id_or_uuid, -> (id) { (Float(id) rescue nil).present? ? where(id: id) : where(uuid: id) }
|
||||||
|
|
||||||
validates_length_of :description, maximum: 100, message: "不能超过100个字符"
|
validates_length_of :description, maximum: 255, message: "不能超过255个字符"
|
||||||
|
|
||||||
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
|
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue