Before I file a ticket, I’ll query ya’ll about this:
The API docs for acts_as_tree’s counter_cache is to create a database
called “children_count” to hold the counter_cache. I have enabled this
option in my model. While writing tests I wrote a test for creating
from the a parent:
message = @forum_message[“parent”].find
child = message.children.create( “member_id” => 1, “forum_id” => 1,
“subject” => ‘another subject’, “body” => “good grief.”)
This follows the the API docs pretty closely at
However, the test fails for this reason:
ActiveRecord::StatementInvalid: PGError: ERROR: column
“forum_messages_count” does not exist
: UPDATE forum_message SET forum_messages_count = forum_messages_count +
WHERE (id = 1)
The docs do not mention creating a table column based on the model name.
this the now intended behavior?
Where is it documented and can the name of the column be overridden?
Thank you for any help.
D. Taylor S.