This repository has been archived by the owner on Mar 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generated models for question, answer, answer_group and subject
- Loading branch information
robmckinnon
committed
Apr 24, 2008
1 parent
939c411
commit 0909a29
Showing
17 changed files
with
131 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class AnswerGroup < ActiveRecord::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Subject < ActiveRecord::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE "answer_groups" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "anchor" varchar(255) DEFAULT NULL, "date" date DEFAULT NULL, "minor_subject_id" integer DEFAULT NULL, "subject_id" integer DEFAULT NULL, "url" varchar(255) DEFAULT NULL, "created_at" datetime DEFAULT NULL, "updated_at" datetime DEFAULT NULL); | ||
CREATE TABLE "answers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "member" varchar(255) DEFAULT NULL, "answer_group_id" integer DEFAULT NULL, "role" varchar(255) DEFAULT NULL, "text" varchar(255) DEFAULT NULL, "created_at" datetime DEFAULT NULL, "updated_at" datetime DEFAULT NULL); | ||
CREATE TABLE "questions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "member" varchar(255) DEFAULT NULL, "text" varchar(255) DEFAULT NULL, "uin" varchar(255) DEFAULT NULL, "answer_id" integer DEFAULT NULL, "created_at" datetime DEFAULT NULL, "updated_at" datetime DEFAULT NULL); | ||
CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL); | ||
CREATE TABLE "subjects" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) DEFAULT NULL, "created_at" datetime DEFAULT NULL, "updated_at" datetime DEFAULT NULL); | ||
CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class CreateAnswerGroups < ActiveRecord::Migration | ||
def self.up | ||
create_table :answer_groups do |t| | ||
t.string :anchor | ||
t.date :date | ||
t.integer :minor_subject_id | ||
t.integer :subject_id | ||
t.string :url | ||
|
||
t.timestamps | ||
end | ||
end | ||
|
||
def self.down | ||
drop_table :answer_groups | ||
end | ||
end |
5 changes: 1 addition & 4 deletions
5
db/migrate/20080423170752_create_answers.rb → db/migrate/20080424150652_create_answers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class CreateSubjects < ActiveRecord::Migration | ||
def self.up | ||
create_table :subjects do |t| | ||
t.string :name | ||
|
||
t.timestamps | ||
end | ||
end | ||
|
||
def self.down | ||
drop_table :subjects | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
||
one: | ||
anchor: MyString | ||
date: 2008-04-24 | ||
minor_subject_id: 1 | ||
subject_id: 1 | ||
url: MyString | ||
|
||
two: | ||
anchor: MyString | ||
date: 2008-04-24 | ||
minor_subject_id: 1 | ||
subject_id: 1 | ||
url: MyString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
||
one: | ||
date: 2008-04-23 | ||
major_subject: MyString | ||
member: MyString | ||
minor_subject: MyString | ||
answer_group_id: 1 | ||
role: MyString | ||
text: MyString | ||
title: MyString | ||
|
||
two: | ||
date: 2008-04-23 | ||
major_subject: MyString | ||
member: MyString | ||
minor_subject: MyString | ||
answer_group_id: 1 | ||
role: MyString | ||
text: MyString | ||
title: MyString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
||
one: | ||
name: MyString | ||
|
||
two: | ||
name: MyString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe AnswerGroup do | ||
before(:each) do | ||
@answer_group = AnswerGroup.new | ||
end | ||
|
||
it "should be valid" do | ||
@answer_group.should be_valid | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe Answer do | ||
before(:each) do | ||
@answer = Answer.new | ||
end | ||
|
||
it "should be valid" do | ||
@answer.should be_valid | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe Question do | ||
before(:each) do | ||
@question = Question.new | ||
end | ||
|
||
it "should be valid" do | ||
@question.should be_valid | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe Subject do | ||
before(:each) do | ||
@subject = Subject.new | ||
end | ||
|
||
it "should be valid" do | ||
@subject.should be_valid | ||
end | ||
end |