Merge pull request #104 from AyuntamientoMadrid/debates_title_length_93
Debates title length
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
require 'numeric'
|
||||
class Debate < ActiveRecord::Base
|
||||
|
||||
TITLE_LENGTH = Debate.columns.find{|c| c.name == 'title'}.limit
|
||||
|
||||
acts_as_votable
|
||||
acts_as_commentable
|
||||
acts_as_taggable
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<p><strong><%= t("debates.form.debate_title") %></strong></p>
|
||||
<p><%= t("debates.form.title_instructions") %></p>
|
||||
<%= f.text_field :title %>
|
||||
<%= f.text_field :title, maxlength: Debate::TITLE_LENGTH %>
|
||||
|
||||
<br/>
|
||||
<p><strong><%= t("debates.form.debate_text") %></strong></p>
|
||||
|
||||
5
db/migrate/20150806111435_change_debates_title_length.rb
Normal file
5
db/migrate/20150806111435_change_debates_title_length.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class ChangeDebatesTitleLength < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :debates, :title, :string, limit: 80
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20150731110702) do
|
||||
ActiveRecord::Schema.define(version: 20150806111435) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -34,11 +34,11 @@ ActiveRecord::Schema.define(version: 20150731110702) do
|
||||
add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree
|
||||
|
||||
create_table "debates", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.string "title", limit: 80
|
||||
t.text "description"
|
||||
t.integer "author_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "taggings", force: :cascade do |t|
|
||||
|
||||
Reference in New Issue
Block a user