Skip to content

Instantly share code, notes, and snippets.

View mattmenefee's full-sized avatar

Matt Menefee mattmenefee

View GitHub Profile
# Deploy and rollback on Heroku in staging and production
# Reference:
# http://casperfabricius.com/site/2009/09/20/manage-and-rollback-heroku-deployments-capistrano-style/
# https://gist.github.com/362873/
namespace :deploy do
PRODUCTION_APP = 'sozialite'
STAGING_APP = 'sozialitedev'
desc 'Deploy app to staging'
Shopping List
for
Wednesday, June 12th
at
Mars
# derived from http://railscasts.com/episodes/340-datatables
# handles server side multi-column searching and sorting
class Datatable
delegate :params, :h, :raw, :link_to, :number_to_currency, to: :@view
def initialize(klass,view)
@klass = klass
@view = view
end
@mattmenefee
mattmenefee / gist:2765689
Created May 22, 2012 00:33
Issue adding Rolify role
user.add_role :admin
[DEBUG] Role Load (38.2ms) SELECT "roles".* FROM "roles" WHERE (("roles"."name" = "roles"."admin" AND "roles"."resource_type" IS NULL AND "roles"."resource_id" IS NULL)) LIMIT 1
ActiveRecord::StatementInvalid: PG::Error: ERROR: column roles.admin does not exist
LINE 1: ... "roles".* FROM "roles" WHERE (("roles"."name" = "roles"."a...
^
: SELECT "roles".* FROM "roles" WHERE (("roles"."name" = "roles"."admin" AND "roles"."resource_type" IS NULL AND "roles"."resource_id" IS NULL)) LIMIT 1
from /Users/matt/.rvm/gems/ruby-1.9.3-p0@ruby1.9.3p0/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1139:in `async_exec'
from /Users/matt/.rvm/gems/ruby-1.9.3-p0@ruby1.9.3p0/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1139:in `exec_no_cache'
from /Users/matt/.rvm/gems/ruby-1.9.3-p0@ruby1.9.3p0/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgre