parent
08115c9de4
commit
445d29d036
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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' %>
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
@ -449,7 +449,7 @@ ActiveRecord::Schema.define(:version => 20140812065417) do
|
|||
|
||||
create_table "forums", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
t.string "description", :default => ""
|
||||
t.text "description"
|
||||
t.integer "topic_count", :default => 0
|
||||
t.integer "memo_count", :default => 0
|
||||
t.integer "last_memo_id", :default => 0
|
||||
|
|
Loading…
Reference in New Issue