Skip to content

Instantly share code, notes, and snippets.

@thewoolleyman
Created January 27, 2010 10:06
Show Gist options
  • Select an option

  • Save thewoolleyman/287705 to your computer and use it in GitHub Desktop.

Select an option

Save thewoolleyman/287705 to your computer and use it in GitHub Desktop.
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index a56eb3e..0cb4c2a 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -1,4 +1,5 @@
class ProjectsController < ApplicationController
+ caches_page :index, :show, :code
verify :params => "id", :only => [:show, :build, :code],
:render => { :text => "Project not specified",
@@ -28,6 +29,7 @@ class ProjectsController < ApplicationController
end
def build
+ expire_page :action => [:index, :show, :code]
render :text => 'Build requests are not allowed', :status => 403 and return if Configuration.disable_build_now
@project = Project.find(params[:id])
diff --git a/config/environments/development.rb b/config/environments/development.rb
index b13ac48..d3a7656 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -12,7 +12,7 @@ config.whiny_nils = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
+config.action_controller.perform_caching = true
config.action_view.debug_rjs = true
# Don't care if the mailer can't send
Processing ProjectsController#build (for 127.0.0.1 at 2010-01-27 03:00:31) [POST]
Parameters: {"authenticity_token"=>"6BH7VDUvsP1w7fjdxseHjQke2zAWV6Zw1KumDTzj0EY=", "id"=>"dummyrepo", "_"=>""}
ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
Processing ProjectsController#build (for 127.0.0.1 at 2010-01-27 03:00:53) [POST]
Parameters: {"authenticity_token"=>"HKPUwANTFXW7uq6TizT+nHmPBGFxZcsHmypDaRKl7vM=", "id"=>"dummyrepo", "_"=>""}
Expired page: /index.html (0.3ms)
Expired page: /projects/dummyrepo.html (0.1ms)
Expired page: /projects/code/dummyrepo.html (0.0ms)
Rendering projects/index_js
ActionView::TemplateError (No such file or directory - /Users/woolley/.cruise/projects/dummyrepo/build-bdd823849cf8e9338bd7ab960744a30ced28f1de.69290) on line #1 of app/views/projects/_project.html.erb:
1: <div id="project_<%= project.name %>" class="project build_<%= project.last_complete_build_status %>">
2: <table class="project_pane">
3: <tr>
4:
app/models/build_status.rb:51:in `mtime'
app/models/build_status.rb:51:in `timestamp'
app/models/build.rb:125:in `time'
app/models/project.rb:506:in `each'
app/models/project.rb:506:in `sort_by'
app/models/project.rb:506:in `order_by_label'
app/models/project.rb:198:in `builds'
app/models/project.rb:240:in `last_complete_build'
app/models/project.rb:250:in `last_complete_build_status'
app/views/projects/_project.html.erb:1
app/views/projects/index_js.js.rjs:1:in `__instance_exec0'
app/views/projects/index_js.js.rjs:1:in `_run_rjs_app47views47projects47index_js46js46rjs'
app/controllers/projects_controller.rb:41:in `build'
app/controllers/projects_controller.rb:41:in `build'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment