Skip to content

Instantly share code, notes, and snippets.

View dankozlowski's full-sized avatar
🌲
Steady in the storm!

Dan Kozlowski dankozlowski

🌲
Steady in the storm!
  • Portland, OR
View GitHub Profile
# Defines a new sequence
FactoryGirl.define do
sequence :email do |n|
"person#{n}@example.com"
end
end
generate :email
# => "person1@example.com"
class Film < ActiveRecord::Base
belongs_to :user
has_attached_file :video,
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:path => "#{film.user.id}/#{film.title}.:extension",
:bucket => 'filmskillet-films-received'
def update
@organization = current_user.organizations.find(params[:id])
respond_to do |format|
if @organization.update_attributes(params[:organization])
format.html { redirect_to(@organization, :notice => 'Organization was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }
Started POST "/organizations" for 127.0.0.1 at 2011-02-14 13:41:15 -0800
Processing by OrganizationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"HKyJ6cwogJlmKsKgONi7driusIK9w7WnSa8PY/s8DvY=", "organization"=>{"user_id"=>"1", "title"=>"World Aid TV", "tagline"=>"Helping the World since 2011", "description"=>"We are a non-profit mission organization based in Santa Barbara, California. We like to help people connect across the globe to help those in need. We transfer all of our donations directly to the groups! We keep nothing!"}, "commit"=>"Save Organization"}
User Load (0.6ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 1) LIMIT 1
AREL (0.5ms) INSERT INTO "organizations" ("user_id", "title", "tagline", "description", "created_at", "updated_at", "avatar_file_name", "avatar_content_type", "avatar_file_size", "avatar_updated_at") VALUES (1, 'World Aid TV', 'Helping the World since 2011', 'We are a non-profit mission organization based in Santa Barbara, California
Started GET "/organizations/10" for 127.0.0.1 at 2011-02-14 13:40:24 -0800
Processing by OrganizationsController#show as HTML
Parameters: {"id"=>"10"}
User Load (0.8ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 1) LIMIT 1
Organization Load (0.8ms) SELECT "organizations".* FROM "organizations" WHERE ("organizations"."id" = 10) LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 1) LIMIT 1
Rendered organizations/show.html.erb within layouts/application (21.8ms)
Completed 200 OK in 75ms (Views: 26.8ms | ActiveRecord: 2.6ms)
Started POST "/organizations" for 127.0.0.1 at 2011-02-14 13:41:15 -0800
Processing by OrganizationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"HKyJ6cwogJlmKsKgONi7driusIK9w7WnSa8PY/s8DvY=", "organization"=>{"user_id"=>"1", "title"=>"World Aid TV", "tagline"=>"Helping the World since 2011", "description"=>"We are a non-profit mission organization based in Santa Barbara, California. We like to help people connect across the globe to help those in need. We transfer all of our donations directly to the groups! We keep nothing!"}, "commit"=>"Save Organization"}
User Load (0.6ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 1) LIMIT 1
AREL (0.5ms) INSERT INTO "organizations" ("user_id", "title", "tagline", "description", "created_at", "updated_at", "avatar_file_name", "avatar_content_type", "avatar_file_size", "avatar_updated_at") VALUES (1, 'World Aid TV', 'Helping the World since 2011', 'We are a non-profit mission organization based in Santa Barbara, California
Started POST "/organizations" for 127.0.0.1 at 2011-02-14 13:41:15 -0800
Processing by OrganizationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"HKyJ6cwogJlmKsKgONi7driusIK9w7WnSa8PY/s8DvY=", "organization"=>{"user_id"=>"1", "title"=>"World Aid TV", "tagline"=>"Helping the World since 2011", "description"=>"We are a non-profit mission organization based in Santa Barbara, California. We like to help people connect across the globe to help those in need. We transfer all of our donations directly to the groups! We keep nothing!"}, "commit"=>"Save Organization"}
User Load (0.6ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 1) LIMIT 1
AREL (0.5ms) INSERT INTO "organizations" ("user_id", "title", "tagline", "description", "created_at", "updated_at", "avatar_file_name", "avatar_content_type", "avatar_file_size", "avatar_updated_at") VALUES (1, 'World Aid TV', 'Helping the World since 2011', 'We are a non-profit mission organization based in Santa Barbara, California
!!! Strict
%html
%head
= render "shared/head"
//%link{ :href => "http://fonts.googleapis.com/css?family=Arvo", :rel => "stylesheet", :type => "text/css" }
//%meta{ :"http-equiv" => "Content-Type", :content => "text/html", :charset => "utf-8" }
%body
#container_inner
!!! Strict
%html
%head
= render "shared/head"
//%link{ :href => "http://fonts.googleapis.com/css?family=Arvo", :rel => "stylesheet", :type => "text/css" }
//%meta{ :"http-equiv" => "Content-Type", :content => "text/html", :charset => "utf-8" }
%body
#container_inner
defaults: &defaults
adapter: 'mysql2'
username: 'root'
password: 'abs123'
host: 'localhost'
development:
<<: *defaults
database: 'merchant_world_dev'