Skip to content

Instantly share code, notes, and snippets.

View anlek's full-sized avatar
💬
Writing code...

Andrew Kalek anlek

💬
Writing code...
View GitHub Profile
@anlek
anlek / cucumber.log
Created March 11, 2010 00:41
Issue when running cucumber with subdomains
Processing SessionController#new (for 127.0.0.1 at 2010-03-10 19:39:54) [GET]
Account Load (0.3ms) SELECT * FROM `accounts` WHERE (`accounts`.`subdomain` = 'example') LIMIT 1
Redirected to http://www.org/signin
Filter chain halted as [:fetch_account] rendered_or_redirected.
Completed in 13ms (DB: 13) | 302 Found [http://example.org/signin]
Processing SessionController#new (for 127.0.0.1 at 2010-03-10 19:39:54) [GET]
Rendering template within layouts/session
Rendering session/new
@anlek
anlek / account.feature
Created March 11, 2010 05:51
Issues with Cucumber and Subdomains when submitting a form. Found out that it was due to Capybara not playing well with subdomains
Scenario: Admin should be able to login to any account
Given I login as "admin@example.com" with password "1234" to subdomain "microsoft"
Then I should see "Signed in successfully"
And the subdomain should be "microsoft"
THIS DOCUMENT MOVED TO http://chneukirchen.github.com/rps/
AND http://github.com/chneukirchen/rps
= Ruby Packaging Standard
The aim of this document is two-fold. First, to specify a common
structure of how a Ruby package distributed as source (that is, but
not limited to, development directories, version-controlled
repositories, .tar.gz, Gems, ...) should conform to.
alias reload='. ~/.bashrc'
alias ea="$EDITOR ~/bin/dotfiles/bash/aliases && reload"
alias ee="$EDITOR ~/bin/dotfiles/bash/env && reload"
alias eh="$EDITOR ~/bin/dotfiles/bash/heroku && reload"
# Processes
alias tu='top -o cpu'
alias tm='top -o vsize'
# Projects
NoMethodError in Chapter_requests#show
Showing app/views/chapter_requests/show.html.haml where line #3 raised:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.include?
Extracted source (around line #3):
class UsersController < ApplicationController
#only showing new, but you'll most likely have index, show, edit, destroy and all those
def new
@user = current_group.users.new
end
def create
@user = current_group.users.new(params[:user])
belongs_to :creator, :class_name => "User", :foreign_key => "creator_id"
belongs_to :user, :class_name => "User", :foreign_key => "user_id"
NameError in Sessions#new
Showing app/views/layouts/application.html.erb where line #50 raised:
uninitialized class variable @@database_name in MongoMapper
Application Trace
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo_mapper-0.7.0/lib/mongo_mapper.rb:57:in `database'
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/mongo_mapper-0.7.0/lib/mongo_mapper/document.rb:210:in `database'
u = User.new
u.images
NoMethodError: undefined method `images' for #<User:0x3666c98>
from /usr/local/lib/ruby/gems/1.8/gems/mongo_mapper-0.7.6/lib/mongo_mapper/plugins/dirty.rb:25:in `method_missing'
from (irb):9
u.user_images
=> []
module Paperclip
class << self
def logger #:nodoc:
MongoMapper.logger
end
end
module ClassMethods
def has_attached_file name, options = {}
include InstanceMethods