Skip to content

Instantly share code, notes, and snippets.

View mdarby's full-sized avatar
💭
pending validation

Matt Darby mdarby

💭
pending validation
View GitHub Profile
all_models = Dir.glob( File.join( RAILS_ROOT, 'app', 'models', '*.rb') ).map{|path| path[/.+\/(.+).rb/,1] }
ar_models = all_models.select{|m| m.classify.constantize < ActiveRecord::Base}
def self.get_latest_items_for(current_user)
assigned_job_ids = current_user.jobs.collect(&:id)
find(:all, :conditions => ["job_id in (?)", assigned_job_ids])
end
RecentItem.get_latest_items_for(current_user)
ec2-authorize default -p 443
git submodule add git://github.com/mdarby/restful_acl.git vendor/plugins/restful_acl
git commit -a
git submodule init
git submodule update
git svn clone user@host:/path/to/repo
git clone git://github.com/mdarby/restful_acl.git
date.strftime("%B #{date.day.ordinalize}, %Y")
describe "A Car" do
before(:each) do
@car = mock_model(Car)
@driver = mock_model(Driver)
end
it "should have a color" do
@car.color = nil
@car.should_not be_valid
end