layout | title | description | tags | ||
---|---|---|---|---|---|
default |
SQL Style Guide |
A guide to writing clean, clear, and consistent SQL. |
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note that this *will not load your Rails configuration* which means things like | |
# mass assignment protection by default, etc. will not be set. | |
require "active_record" | |
ActiveRecord::Base.configurations = YAML.load_file(File.expand_path("../../config/database.yml", __FILE__)) | |
ActiveRecord::Base.establish_connection("test") | |
# Stick your ActiveRecord junk (i.e. extensions) here | |
require "database_cleaner" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A polymorphic has_many :through relationship in Rails 2.3 | |
# based on Josh Susser's "The other side of polymorphic :through associations" | |
# http://blog.hasmanythrough.com/2006/4/3/polymorphic-through | |
class Authorship < ActiveRecord::Base | |
belongs_to :author | |
belongs_to :publication, :polymorphic => true | |
end | |
class Author < ActiveRecord::Base | |
has_many :authorships |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# implementation at http://gist.github.com/3350 | |
require 'spec_helper' | |
describe HoptoadErrors do | |
describe '.find :all' do | |
before(:each) do | |
@errors = HoptoadErrors.find :all | |
end |