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
models = ActiveRecord::Base.connection.tables | |
models.delete(ActiveRecord::Migrator.schema_migrations_table_name) | |
models.each do |table| | |
ActiveRecord::Base.connection.reset_pk_sequence!(table) | |
end |
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
# in rails application.rb | |
initializer "postgresql.no_default_string_limit" do | |
ActiveSupport.on_load(:active_record) do | |
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:string].delete(:limit) | |
end | |
end |
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
#open all new and modified files in textmate tabs for open project: | |
git status -s -uall | cut -b 4- | xargs -n 1 mate |
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
$ defaults write com.apple.dock pinning -string end | |
$ killall Dock |
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
initdb -U postgres --encoding=utf8 --locale=en_US -D /usr/local/var/postgres |
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
( roughly to the tune of the Ultraman theme song: | |
http://www.televisiontunes.com/Ultraman.html ) | |
Tenderlove, Tenderlove | |
Ruby programming guy | |
Tenderlove, Tenderlove | |
he's as awesome as _why | |
Seattle is his home | |
he's a Ruby brigadier |
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
require 'spec_helper' | |
describe Example::RegistrationsController do | |
before(:each) do | |
setup_controller_for_warden | |
request.env["devise.mapping"] = Devise.mappings[:example] | |
end | |
describe "sign up" do | |
it "does something" |
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
module BuildModels | |
def self.builder | |
Proc.new do | |
# create models... | |
end | |
end | |
end |
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
## Gemfile | |
gem "mail_safe", "~> 0.3.1", :require => false | |
## RAILS_APP/config/environments/demo.rb | |
require "mail_safe" # don't spam emails in demo | |
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
# reset tables | |
tables = ActiveRecord::Base.connection.tables | |
tables.delete("schema_migrations") | |
tables.each do |table| | |
ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{table}") | |
ActiveRecord::Base.connection.reset_pk_sequence!(table) | |
end | |
# seed data | |
# |