Displaying 3 results from an estimated 3 matches for "discussion_id".
2008 Mar 29
0
message board help
...to a
problem
I get this error message
SQLite3::SQLException: table posts already exists: CREATE TABLE posts
("id" INTE
GER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text DEFAULT NULL,
"created_at" d
atetime NOT NULL, "name" varchar(100) DEFAULT NULL, "discussion_id"
integer NOT
NULL)
when I try to migrate this bit of code
class CreatePostsTable < ActiveRecord::Migration
def self.up
create_table :posts do |table|
table.column :body, :text
table.column :created_at, :datetime, :null => false
table.column :name, :string, :limit=>1...
2007 Mar 27
7
Eager loading not working well for me
Man my app is causing me so much grief lately.
Okay let''s say I have:
class Discussion
has_many :posts
end
class Post
belongs_to :discussion
acts_as_tree
end
Then let''s say I grab a discussion object and try to eager load all of
its posts:
discussion = Discussion.find(:first, :include => [:posts])
Seems simple enough and it grabs an entire tree of posts. However:
2006 Feb 18
2
Question: Table referenced by many tables
Hi my name is Nathan,
I am building a website using Ruby on Rails and a MySQL database. The
premise is that every news item and piece of article content or a
download etc each has it''s own forum.
Currently I have it set up so that my News, Content, and Downloads
tables each have a discussion_id column. The Discussion table is then
referenced by Forums, Forums are referenced by Threads and Threads are
referenced by Posts.
This way any piece of content on my website can have it''s own set of
forums.
The problem is that Discussion has no way of knowing which table is
referencin...