diff options
author | 2010-07-12 18:47:01 +0200 | |
---|---|---|
committer | 2010-07-29 19:49:13 +0200 | |
commit | 84c29dd7f3fc64ea491f0342476f7bc31a20171f (patch) | |
tree | 6bd86e4dac5bc216de46c5e18569de8deeaf012d /db | |
parent | Allow project leads to add Project Acceptances easily (diff) | |
download | recruiting-webapp-84c29dd7f3fc64ea491f0342476f7bc31a20171f.tar.gz recruiting-webapp-84c29dd7f3fc64ea491f0342476f7bc31a20171f.tar.bz2 recruiting-webapp-84c29dd7f3fc64ea491f0342476f7bc31a20171f.zip |
Email questions
Also make sure users can answer questions with multiple and text
content and can't answer email questions within application. Added
"Gentoo-dev-announce posting" question to seed
Diffstat (limited to 'db')
-rw-r--r-- | db/fixtures/questions-email.yml | 14 | ||||
-rw-r--r-- | db/schema.rb | 14 | ||||
-rw-r--r-- | db/seeds.rb | 5 |
3 files changed, 32 insertions, 1 deletions
diff --git a/db/fixtures/questions-email.yml b/db/fixtures/questions-email.yml new file mode 100644 index 0000000..6ad2d95 --- /dev/null +++ b/db/fixtures/questions-email.yml @@ -0,0 +1,14 @@ +email_q1: + title: Gentoo-dev-announce posting + documentation: + question_category: ebuild + content: "Email a major eclass change announcement. Replace all + @gentoo.org addresses with @localhost addresses. + The from field should match email you set in the application. + \n\nTo configure postfix use for example recruiting: + \n\n gentoo-dev-announce: | \"curl -F 'email=<-' http://localhost:3000/users/receive_email\" + \n gentoo-dev: /dev/null + \n\nin /etc/mail/aliases." + req_text: 'To : gentoo-dev-announce@localhost + To : gentoo-dev@localhost + Reply-to : gentoo-dev@localhost' diff --git a/db/schema.rb b/db/schema.rb index 15b0b5a..c9db40b 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 => 20100728172058) do +ActiveRecord::Schema.define(:version => 20100729170624) do create_table "answers", :force => true do |t| t.text "content" @@ -21,6 +21,7 @@ ActiveRecord::Schema.define(:version => 20100728172058) do t.integer "owner_id" t.string "type" t.string "feedback", :default => "" + t.boolean "correct" end add_index "answers", ["owner_id"], :name => "index_answers_on_owner_id" @@ -64,6 +65,16 @@ ActiveRecord::Schema.define(:version => 20100728172058) do t.datetime "updated_at" end + create_table "question_content_emails", :force => true do |t| + t.text "requirements", :default => "" + t.text "description" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "question_id" + end + + add_index "question_content_emails", ["question_id"], :name => "index_question_content_emails_on_question_id" + create_table "question_content_multiple_choices", :force => true do |t| t.text "content", :null => false t.datetime "created_at" @@ -141,6 +152,7 @@ ActiveRecord::Schema.define(:version => 20100728172058) do t.string "state", :default => "active" t.datetime "key_timestamp" t.boolean "project_lead", :default => false + t.string "token" end add_index "users", ["mentor_id"], :name => "index_users_on_mentor_id" diff --git a/db/seeds.rb b/db/seeds.rb index a2b4daf..afed2eb 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -79,6 +79,11 @@ seeder.read_yaml('db/fixtures/questions-multichoice.yml', Question, ['question_c end end +# Questions with email content - load from YAML file +seeder.read_yaml('db/fixtures/questions-email.yml', Question, ['question_category', 'question_group']) do |name, hash, objects, klass| + objects[name] = klass.create!(hash - {'content' => nil, 'req_text' => nil}) + objects["#{name}-content"] = QuestionContentEmail.create! :question => objects[name], :description=> hash['content'], :req_text => hash['req_text'] +end # Users - load from YAML file seeder.read_yaml 'db/fixtures/users.yml', User, 'mentor' |