Skip to content

Instantly share code, notes, and snippets.

class User
# ...
def method_missing(sym, *args)
if sym.to_s =~ /\A(.*)\?\z/ && ROLES.include?($1)
roles.include?($1)
else
super
end
end
@conversionfoundry
conversionfoundry / underscore.tmsnippet
Created November 5, 2009 01:00
TextMate snippet to underscore the current selection (HaveASandwich => have_a_sandwich)
${TM_SELECTED_TEXT/((\b[A-Z])|([A-Z]))/(?2:\l$2)(?3:_\l$3)/g}
module Component::QuoteManager
class Configuration < Base
unloadable
# This is a hook that gets called whenever BreezeHQ is sending out a form response.
# The email still gets sent out, but this will let you grab the form responses
# when they're created.
# For sanity reasons, return message at the end.
def send_form_response(message)
QuoteProcessor.new(message.id).send_later(:process!)