From 64bb6a6491bd86fd38d286605629c0955cafb512 Mon Sep 17 00:00:00 2001 From: Mike Green Date: Fri, 15 Feb 2008 01:59:39 -0500 Subject: [PATCH] added filter to application controller for authentication, created model associations --- Folio.tmproj | 42 +++++++++++++++++++++++++++++++----------- app/controllers/application.rb | 5 ++++- app/models/category.rb | 1 + app/models/client.rb | 1 + app/models/project.rb | 4 ++++ 5 files changed, 41 insertions(+), 12 deletions(-) diff --git a/Folio.tmproj b/Folio.tmproj index 2002fcb..e5b4f78 100644 --- a/Folio.tmproj +++ b/Folio.tmproj @@ -3,7 +3,7 @@ currentDocument - app/controllers/account_controller.rb + app/controllers/projects_controller.rb documents @@ -26,23 +26,39 @@ caret column - 0 + 34 line - 0 + 4 + columnSelection + firstVisibleColumn 0 firstVisibleLine 0 + selectFrom + + column + 2 + line + 4 + + selectTo + + column + 34 + line + 4 + app/controllers/application.rb caret column - 0 + 1 line - 10 + 5 firstVisibleColumn 0 @@ -63,28 +79,28 @@ firstVisibleLine 0 - app/models/category.rb + app/controllers/clients_controller.rb caret column - 29 + 0 line - 3 + 0 firstVisibleColumn 0 firstVisibleLine 0 - app/models/project.rb + app/controllers/projects_controller.rb caret column 0 line - 7 + 0 firstVisibleColumn 0 @@ -123,10 +139,14 @@ openDocuments app/controllers/account_controller.rb + app/controllers/categories_controller.rb + app/controllers/clients_controller.rb + app/controllers/projects_controller.rb + app/controllers/application.rb showFileHierarchyDrawer windowFrame - {{216, 73}, {926, 789}} + {{138, 71}, {926, 789}} diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 07ed80d..bde9c2d 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -2,9 +2,12 @@ # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base - helper :all # include all helpers, all the time + before_filter :login_from_cookie + helper :all # include all helpers, all the time # See ActionController::RequestForgeryProtection for details # Uncomment the :secret if you're not using the cookie session store protect_from_forgery # :secret => '2fa76b213c12006c33dd29f05e672d4e' + + end diff --git a/app/models/category.rb b/app/models/category.rb index 910a009..7512ed1 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -1,2 +1,3 @@ class Category < ActiveRecord::Base + has_many :projects end diff --git a/app/models/client.rb b/app/models/client.rb index 998b2e4..485126e 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -1,2 +1,3 @@ class Client < ActiveRecord::Base + has_many :projects end diff --git a/app/models/project.rb b/app/models/project.rb index 5bc7957..5ae7322 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1,2 +1,6 @@ class Project < ActiveRecord::Base + acts_as_taggable + + belongs_to :category + belongs_to :client end -- 2.11.4.GIT