diff --git a/app/models/forum.rb b/app/models/forum.rb index cd9c210dd..24b5b15e0 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -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 diff --git a/app/models/memo.rb b/app/models/memo.rb index 5a909f782..2c0d3571f 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -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" diff --git a/app/views/forums/new.html.erb b/app/views/forums/new.html.erb index 19c911c37..2e8924c90 100644 --- a/app/views/forums/new.html.erb +++ b/app/views/forums/new.html.erb @@ -4,7 +4,7 @@ @nav_dispaly_main_contest_label = 1 %> <% @nav_dispaly_forum_label = 1%> -

<%= l :label_forum_new %>

+

<%= l :label_forum_new %>

<%= render 'form' %> diff --git a/db/migrate/20140814062455_change_forum_description.rb b/db/migrate/20140814062455_change_forum_description.rb new file mode 100644 index 000000000..1bcd81d81 --- /dev/null +++ b/db/migrate/20140814062455_change_forum_description.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 0a24b0ac1..525cfb745 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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|