Permalink
Browse files

modified data setup for association code

  • Loading branch information...
1 parent 79fc8c1 commit 874c63b1de76b26371a32ca814e310bf5de2a781 rsl committed Sep 24, 2008
Showing with 11 additions and 0 deletions.
  1. +2 −0 test/comment.rb
  2. +3 −0 test/entry.rb
  3. +6 −0 test/schema.rb
View
@@ -1,3 +1,5 @@
class Comment < ActiveRecord::Base
+ belongs_to :entry
+
acts_as_snook # Defaults
end
View
@@ -0,0 +1,3 @@
+class Entry < ActiveRecord::Base
+ has_many :comments
+end
View
@@ -2,7 +2,13 @@
ActiveRecord::Schema.define(:version => 1) do
create_table :comments, :force => true do |t|
+ t.integer :entry_id
t.string :author, :email, :url, :spam_status
t.text :body
end
+
+ create_table :entries, :force => true do |t|
+ t.string :title
+ t.integer :ham_comments_count, :default => 0
+ end
end

0 comments on commit 874c63b

Please sign in to comment.