Skip to content

Instantly share code, notes, and snippets.

View adahl's full-sized avatar

Andrew Dahl adahl

View GitHub Profile
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
if ARGV.grep(/rubber:/).empty?
require File.expand_path('../config/application', __FILE__)
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
Pithos::Application.load_tasks
@adahl
adahl / gist:787698
Created January 20, 2011 10:16
Case-insensitive email with devise
# User model
before_save :downcase_email
class << self
def find_for_authentication(conditions)
conditions[:email].try(:downcase!)
super
end
### DEVISE 1.1.3 ###
class User < ActiveRecord::Base
before_save :downcase_email
def self.find_for_authentication(conditions)
conditions[:email].try(:downcase!)
super
end
1.
----
InvitesController
def new
- show invite form
end
def create
class Customer < ActiveRecord::Base
has_many :groups
end
class Group < ActiveRecord::Base
belongs_to :customer
has_many :members
has_many :people, :through => :members
end
class UnwireController << Controller
def create <-- incoming message
IncomingMessageUnwire.create(params)
end
def update <-- delivery notification
OutgoingMessageUnwire.update(params)
end
end