1.修改新建帖子的长度上限设置,设置为2G

2.修改新建贴吧时贴吧的描述字段类型
This commit is contained in:
sw 2014-08-14 14:38:18 +08:00
parent 08115c9de4
commit 445d29d036
5 changed files with 18 additions and 9 deletions

View File

@ -11,7 +11,7 @@ class Forum < ActiveRecord::Base
'creator_id'
validates_presence_of :name, :creator_id, :description
validates_length_of :name, maximum: 50
validates_length_of :description, maximum: 255
#validates_length_of :description, maximum: 255
validates :name, :uniqueness => true
acts_as_taggable

View File

@ -8,7 +8,7 @@ class Memo < ActiveRecord::Base
# 若是主题帖,则内容可以是空
#validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? }
validates_length_of :subject, maximum: 50
validates_length_of :content, maximum: 3072
#validates_length_of :content, maximum: 3072
validate :cannot_reply_to_locked_topic, :on => :create
acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC"

View File

@ -4,7 +4,7 @@
@nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
<!-- added by fq -->
<h3><%= l :label_forum_new %></h1>
<h1><%= l :label_forum_new %></h1>
<%= render 'form' %>

View File

@ -0,0 +1,9 @@
class ChangeForumDescription < ActiveRecord::Migration
def up
change_column :forums, :description, :text, default: nil
end
def down
change_column :forums, :description, :string, default: ''
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140812065417) do
ActiveRecord::Schema.define(:version => 20140814062455) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -448,14 +448,14 @@ ActiveRecord::Schema.define(:version => 20140812065417) do
end
create_table "forums", :force => true do |t|
t.string "name", :null => false
t.string "description", :default => ""
t.string "name", :null => false
t.text "description"
t.integer "topic_count", :default => 0
t.integer "memo_count", :default => 0
t.integer "last_memo_id", :default => 0
t.integer "creator_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "creator_id", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "groups_users", :id => false, :force => true do |t|