Skip to content

Instantly share code, notes, and snippets.

@dagobah
dagobah / sketch.rb
Created July 6, 2012 06:49 — forked from mattwynne/sketch.rb
sketch for Matt Wynne
class Organization
def to_param
"42"
end
def saved?
rand < 0.5
end
end
@dagobah
dagobah / protect.rb
Created August 12, 2011 12:41
How can I get access to the current user here?
###Watered down version, how do I get current_user in the initialize method?
module Protect
extend ActiveSupport::Concern
module ClassMethods
#stuff
end
module InstanceMethods
def initialize (*args, &block)