Skip to content

Instantly share code, notes, and snippets.

View moretea's full-sized avatar

Maarten Hoogendoorn moretea

View GitHub Profile
@moretea
moretea / users_controller.rb
Created January 16, 2011 20:05
config/routes.rb
class UsersController < ApplicationController
def edit
@user = User.find params[:id]
what = params[:what]
if ["birth_day", "location"].member?(what)
render :action => "edit_#{what}"
else
redirect_to :action => :show
end
end
$ cap production deploy
* executing `production'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git@git.nationalebeeldbank.nl:nationalebeeldbank.git production"
* executing "git clone -q git@git.nationalebeeldbank.nl:nationalebeeldbank.git /srv/rails/nbb_production/app/releases/20110128102043 && cd /srv/rails/nbb_production/app/releases/20110128102043 && git checkout -q -b deploy 347d5ae628ff3898f42156e29f3d610e11a13db4 && (echo 347d5ae628ff3898f42156e29f3d610e11a13db4 > /srv/rails/nbb_production/app/releases/20110128102043/REVISION)"
require File.expand_path(File.dirname(__FILE__) + '/../acceptance_helper')
feature "Allow members to log in one week after they are disapproved", %q{
In order to reduce the number of questions I ask
As a member
I want to see a message that my account is going to be blocked in a week from now.
} do
scenario "show the number of days left to login" do
member = Member.make(:status => 0, :grace_period_until => 1.week.from_now)
Started by an SCM change
Checkout:workspace / /var/lib/jenkins/jobs/NationaleBeeldbank_Rails2/workspace - hudson.remoting.LocalChannel@1f67e563
Using strategy: Default
Last Built Revision: Revision 6f84401ec9d2267b6a803f3da650d1b55ef37462 (origin/develop)
Checkout:workspace / /var/lib/jenkins/jobs/NationaleBeeldbank_Rails2/workspace - hudson.remoting.LocalChannel@1f67e563
Fetching changes from the remote Git repository
Fetching upstream changes from git@git.nationalebeeldbank.nl:nationalebeeldbank.git
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
Started by user anonymous
Checkout:workspace / /var/lib/jenkins/jobs/NationaleBeeldbank_Rails2/workspace - hudson.remoting.LocalChannel@1f67e563
Using strategy: Default
Last Built Revision: Revision 6f84401ec9d2267b6a803f3da650d1b55ef37462 (origin/develop)
Checkout:workspace / /var/lib/jenkins/jobs/NationaleBeeldbank_Rails2/workspace - hudson.remoting.LocalChannel@1f67e563
Fetching changes from the remote Git repository
Fetching upstream changes from git@git.nationalebeeldbank.nl:nationalebeeldbank.git
Commencing build of Revision 37c4659bf3daf57064d5def306fa3ad139b8ee06 (origin/develop)
Checking out Revision 37c4659bf3daf57064d5def306fa3ad139b8ee06 (origin/develop)
[workspace] $ /bin/sh -xe /tmp/hudson275583439329321041.sh
# See http://edgeguides.rubyonrails.org/action_mailer_basics.html for action mailer usage
class NotificationMailer < ActionMailer::Base
default :from => "notifications@example.com"
def product_change(product, user)
@product = product
mail(:to => user.email, :subject => "Welcome to My Awesome Site")
end
end
class Product < ActiveRecord::Base
def next
where("id > ?", self.id).first
end
end
class Invoice < ActiveRecord::Base
def self.sequence
AccountingSequence.where(:country => Settings[:country], "Invoice", Date.today.year).first
end
def set_invoice_number
self.invoice_number = self.class.sequence.next!
end
end
class Regatta.AppController extends Backbone.Controller
routes:
":controller/:action": "defaultRoute"
defaultRoute: (controller, action) ->
Regatta.current.controller = controller
Regatta.current.action = action
viewName = controller + "#" + action
view = Regatta.view_instances[viewName]
view.trigger('activated')
class ApplicationController
include Refinery::CMS::MumboJumbo::Etc
def my_helper
end
helper_method :my_helper
end