Skip to content

Commit

Permalink
* migration for statements + statements with it's various subtypes
Browse files Browse the repository at this point in the history
* updated schema
* updated .gitignore to ignore emacs temp files
* added .gitignore to tmp/ directory so that it makes it into git
  • Loading branch information
niklas committed Nov 14, 2009
1 parent 43eac44 commit bd745b2
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ public/system/avatars/
/echologic.ipr /echologic.ipr
/echologic.iws /echologic.iws
db/*.sqlite3 db/*.sqlite3
*~
.\#*
\#*
*\#
2 changes: 2 additions & 0 deletions app/models/argument.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
class Argument < Statement # abstract class
end
2 changes: 2 additions & 0 deletions app/models/contra_argument.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
class ContraArgument < Argument
end
2 changes: 2 additions & 0 deletions app/models/improvement_proposal.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
class ImprovementProposal < Proposal
end
2 changes: 2 additions & 0 deletions app/models/pro_argument.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
class ProArgument < Argument
end
2 changes: 2 additions & 0 deletions app/models/proposal.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
class Proposal < Statement
end
2 changes: 2 additions & 0 deletions app/models/question.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
class Question < Statement
end
8 changes: 8 additions & 0 deletions app/models/statement.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,8 @@
class Statement < ActiveRecord::Base
belongs_to :user
acts_as_tree

validates_presence_of :title
validates_presence_of :text
validates_presence_of :user_id
end
17 changes: 17 additions & 0 deletions db/migrate/20091114161154_create_statements.rb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,17 @@
class CreateStatements < ActiveRecord::Migration
def self.up
create_table :statements do |t|
t.string :title
t.text :text
t.string :type
t.integer :user_id
t.boolean :activated
t.integer :parent_id
t.integer :root_id
end
end

def self.down
drop_table :statements
end
end
12 changes: 11 additions & 1 deletion db/schema.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.


ActiveRecord::Schema.define(:version => 20091102155547) do ActiveRecord::Schema.define(:version => 20091114161154) do


create_table "concernments", :force => true do |t| create_table "concernments", :force => true do |t|
t.integer "user_id" t.integer "user_id"
Expand Down Expand Up @@ -86,6 +86,16 @@
t.datetime "updated_at" t.datetime "updated_at"
end end


create_table "statements", :force => true do |t|
t.string "title"
t.text "text"
t.string "type"
t.integer "user_id"
t.boolean "activated"
t.integer "parent_id"
t.integer "root_id"
end

create_table "tags", :force => true do |t| create_table "tags", :force => true do |t|
t.string "value" t.string "value"
t.datetime "created_at" t.datetime "created_at"
Expand Down
1 change: 1 addition & 0 deletions tmp/.gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
*

0 comments on commit bd745b2

Please sign in to comment.