Skip to content

Instantly share code, notes, and snippets.

View captproton's full-sized avatar

captproton captproton

View GitHub Profile
1) Error:
test_should_get_index(HappeningsControllerTest):
ActionView::TemplateError: Missing template events/_nav.html.erb in view path app/views
On line #4 of app/views/happenings/index.html.erb
1: <% unless current_controller == 'search' %>
2: <div class="calendar-large">
3: <%=
4: calendar({:year => @date.year, :month => @date.month}) do |d|
5: cell_text = "#{d.mday}"
## Missing migration
class AddDemographicsToUsers < ActiveRecord::Migration
def self.up
add_column :users, :name, :string
add_column :users, :company, :string
add_column :users, :phone, :string
add_column :users, :address, :string
add_column :users, :city, :string
add_column :users, :State, :string
##heroku error
Processing UsersController#create (for 76.230.238.81 at 2009-09-04 15:30:30) [POST]
Parameters: {"user"=>{"city"=>"city", "company"=>"company", "name"=>"name", "zip"=>"zip", "password_confirmation"=>"123456", "country"=>"country", "username"=>"yolo", "phone"=>"phone", "address"=>"address", "password"=>"123456", "state"=>"state", "email"=>"rocketeer.captproton@gmail.com"}, "x"=>"111", "y"=>"15", "authenticity_token"=>"dtY3LzSa1fn6mhSapgPdFnTjkqjoNzm+CLqDRBM0Phs="}
Sent mail to rocketeer.captproton@gmail.com
Net::SMTPAuthenticationError (530 5.7.0 Must issue a STARTTLS command first. 17sm523458agd.26
):
/usr/local/lib/ruby/1.8/net/smtp.rb:576:in `auth_plain'
/usr/local/lib/ruby/1.8/net/smtp.rb:570:in `__send__'
@captproton
captproton / gist:185531
Created September 11, 2009 20:06
shoulda errors
## shoulda doesn't like destroy, edit, show, and update
require 'test_helper'
class EventsControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:events)
end
Factory.define :user do |f|
f.sequence(:username) { |n| "user#{n}" }
f.sequence(:email) { |n| "foo#{n}@example.com" }
f.password "MyStringMyStringMyStringMyString"
f.password_confirmation { |u| u.password }
f.invitation_id "298486374"
end
Processing InvitationsController#new (for 69.181.126.252 at 2009-09-15 11:42:07) [GET]
ActiveRecord::StatementInvalid (PGError: ERROR: relation "invitations" does not exist
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = 'invitations'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
):
<?xml version='1.0' encoding='ISO-8859-1'?>
<results><head><lat /><link>http://api.meetup.com/groups/</link><lon /><description>API method for accessing meetup groups</description><total_count>7</total_count><next /><id /><url>http://api.meetup.com/groups/?order=ctime&amp;radius=25&amp;key=4b647120542c495b71384e6048226e22&amp;member_id=2520308&amp;page=200&amp;resource=%2Fgroups.xml%2F&amp;format=xml&amp;offset=0</url><updated>Wed Sep 16 15:24:30 EDT 2009</updated><title>Meetup Groups</title><count>7</count><method>Groups</method></head><items><item><name>The Transformation Collective</name><lon>-122.41999816894531</lon><state>CA</state><id>204000</id><zip>94110</zip><organizerProfileURL>http://www.meetup.com/members/2130324/</organizerProfileURL><country>us</country><photo_url>http://photos1.meetupstatic.com/photos/event/d/4/2/global_6993394.jpeg</photo_url><created>Sun Apr 10 00:56:13 EDT 2005</created><members>402</members><city>San Francisco</city><updated>Wed Sep 16 13:48:17 EDT 2009</updated><lat>37.75<
class Resource < ActiveRecord::Base
include PaperclipSupport
if CONFIG['s3']
has_attached_file :attachment, :storage => :s3, :path => "files/:filename",
:bucket => CONFIG['s3_bucket_name'], # TODO is there a way to share this between models?
:s3_credentials => { :access_key_id => CONFIG['s3_access_id'],
:secret_access_key => CONFIG['s3_secret_key'] },
:s3_headers => { 'Cache-Control' => 'max-age=315576000', 'Expires' => 10.years.from_now.httpdate }
module PaperclipSupport
def self.included(klass)
klass.class_eval do
require 'open-uri'
attr_accessible :attachment, :attachment_url
attr_accessor :attachment_url
before_validation :download_remote_file, :if => :attachment_url_provided?