Add visit_id to debate
This commit is contained in:
@@ -18,6 +18,12 @@ class Debate < ActiveRecord::Base
|
||||
before_validation :sanitize_description
|
||||
before_validation :sanitize_tag_list
|
||||
|
||||
# ahoy setup
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
visitable # Ahoy will automatically assign visit_id on create
|
||||
|
||||
|
||||
def likes
|
||||
get_likes.size
|
||||
end
|
||||
|
||||
5
db/migrate/20150808102442_add_visit_id_to_debate.rb
Normal file
5
db/migrate/20150808102442_add_visit_id_to_debate.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddVisitIdToDebate < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :debates, :visit_id, :string
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20150808100936) do
|
||||
ActiveRecord::Schema.define(version: 20150808102442) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -52,6 +52,7 @@ ActiveRecord::Schema.define(version: 20150808100936) do
|
||||
t.integer "author_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "visit_id"
|
||||
end
|
||||
|
||||
create_table "taggings", force: :cascade do |t|
|
||||
|
||||
Reference in New Issue
Block a user