From 054dea39d40d0d82d804687c575f5b60ff6ea1e1 Mon Sep 17 00:00:00 2001 From: Bryan Larsen Date: Mon, 3 Jun 2013 16:38:22 +0200 Subject: [PATCH] viewhints-children # Specifying view relationships If we tell Hobo which has\_many relationships are significant, Hobo adjusts to display the list of children on its parent's page. We added five has\_many relationships, but only two of them are significant, for now. We specify these in the model file for the parent. SHOW_PATCH --- app/models/project.rb | 2 ++ app/models/story.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/models/project.rb b/app/models/project.rb index cc3d5dc..09933f0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -11,6 +11,8 @@ class Project < ActiveRecord::Base has_many :stories, :dependent => :destroy, :inverse_of => :project + children :stories + # --- Permissions --- # def create_permitted? diff --git a/app/models/story.rb b/app/models/story.rb index 88d4048..03a60f2 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -15,6 +15,8 @@ class Story < ActiveRecord::Base has_many :tasks, :dependent => :destroy, :inverse_of => :story + children :tasks + # --- Permissions --- # def create_permitted?