Displaying 5 results from an estimated 5 matches for "blog_comments".
2007 Feb 01
4
Automatically Indexing Associated Models
...comment does not get
added to the index and is therefore not ferretable. The desired behavior
is that when a comment is added to a blog, that the comment be
ferretable.
CURRENT SETUP
Blog (id, title, body, user_id)
BlogComment (id, blog_id, comment)
class Blog < ActiveRecord::Base
has_many :blog_comments, :dependent => :destroy
acts_as_ferret :additional_fields => [:blog_comments]
def blog_comments
self.blog_comments.collect {|comment| comment.body }
end
end
class BlogComment < ActiveRecord::Base
belongs_to :blog
end
CONTROLLER
[..]
if @blog.blog_comments << comment...
2007 Nov 12
7
schema_info always wants to be 3, even when set to 7
Hi all,
I''m having a very odd problem with db:migrate. I''m using Rails 1.2.5
on Windows XP SP2 and Ruby 1.8.6
I have seven migrations. If I run them with an empty database, it
runs the first three, then halts. When I look in schema_info, the
version is 3.
If I run db:migrate VERSION=7, then it runs through the remaining 4
migrations, and the version is 7 in the DB.
2006 Aug 16
1
Creating a comments system for multiple types of content
Hi all
My site has news entries, it has a party calendar and it has a blog.
Now I''d like to create a commenting system that in fact is quite simple,
but I wanna use it for all these 3 types of content.
My question: how can I do that? I maybe could add an association to all
three types in the comment model:
class Comment < ActiveRecord::Base
belongs_to :news_item
belongs_to
2006 Sep 05
0
rake craziness with Migrate as a dependency
...reateCategories: migrating
================================================
-- create_table(:categories)
-> 0.0700s
== CreateCategories: migrated (0.0700s)
=======================================
== CreateBlogComments: migrating
==============================================
-- create_table(:blog_comments)
-> 0.0900s
== CreateBlogComments: migrated (0.0900s)
=====================================
== CreateSweepstakes: migrating
===============================================
-- add_column(:offers, "type", :text, {:default=>""})
-> 0.2810s
-- add_column(:offers, &qu...
2006 Sep 07
6
form_for - Child object - how to set parent id
...ogs %>
<span class="blog_header"><%=h blog.title %></span>
<span class="blog_date"><%=h blog.date_entered.to_s(:long) %></span>
<span class="blog_body"><%=h blog.body %></span>
<div class="blog_comments">
<span class="blog_comments_count"><%=h
pluralize(blog.comments.size,"comments") %></h2>
<% for comment in blog.comments %>
<div class="comment">
<div class="comment_name">&...