aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-06-23 11:32:26 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-06-24 22:32:32 +0200
commit8922487a577a3258819d9329550efde326b136bc (patch)
tree0e373f0159e44ab30b05d62630966e9510b8e254 /db
parentMentor demoting to recruit (diff)
downloadrecruiting-webapp-8922487a577a3258819d9329550efde326b136bc.tar.gz
recruiting-webapp-8922487a577a3258819d9329550efde326b136bc.tar.bz2
recruiting-webapp-8922487a577a3258819d9329550efde326b136bc.zip
Support for mentor comments
Generated Comment model and CommentsController. Added relation (answer has many comments, comment belongs to answer). Added email notification when new comment is created. This commit includes also schema change and tests.
Diffstat (limited to 'db')
-rw-r--r--db/schema.rb13
-rw-r--r--db/seeds.rb8
2 files changed, 20 insertions, 1 deletions
diff --git a/db/schema.rb b/db/schema.rb
index 5cf5493..5b8285f 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20100603193605) do
+ActiveRecord::Schema.define(:version => 20100616183223) do
create_table "answers", :force => true do |t|
t.text "content"
@@ -24,6 +24,17 @@ ActiveRecord::Schema.define(:version => 20100603193605) do
add_index "answers", ["owner_id"], :name => "index_answers_on_owner_id"
add_index "answers", ["question_id"], :name => "index_answers_on_question_id"
+ create_table "comments", :force => true do |t|
+ t.text "content"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "answer_id"
+ t.integer "owner_id"
+ end
+
+ add_index "comments", ["answer_id"], :name => "index_comments_on_answer_id"
+ add_index "comments", ["owner_id"], :name => "index_comments_on_owner_id"
+
create_table "question_categories", :force => true do |t|
t.string "name"
t.datetime "created_at"
diff --git a/db/seeds.rb b/db/seeds.rb
index ce461bd..2eb9784 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -134,3 +134,11 @@ for q in [mentor_q1, mentor_q2, mentor_q3, ebuild_q1, ebuild_q2, ebuild_q3,
Answer.create! :owner => recruiter, :question => q, :content => "Some reference answer",
:reference => true
end
+
+for ans in advanced.answers
+ Comment.create( :answer => ans, :owner => advanced.mentor, :content => "some comment")
+end
+
+for q in [ebuild_q1, ebuild_q2, ebuild_q3]
+ Comment.create( :answer => q.answer_of(advanced), :owner => advanced.mentor, :content => "some other comment")
+end