Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modified data setup for association code

  • Loading branch information...
commit 874c63b1de76b26371a32ca814e310bf5de2a781 1 parent 79fc8c1
rsl authored
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
2  test/comment.rb
View
@@ -1,3 +1,5 @@
class Comment < ActiveRecord::Base
+ belongs_to :entry
+
acts_as_snook # Defaults
end
3  test/entry.rb
View
@@ -0,0 +1,3 @@
+class Entry < ActiveRecord::Base
+ has_many :comments
+end
6 test/schema.rb
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
Please sign in to comment.
Something went wrong with that request. Please try again.