29 Mar '12, 11pm

Jeff Dean's Ruby Blog - Using MySQL foreign keys, procedures and triggers with Rails (via Instapaper)

module ForeignKeys def add_foreign_key(from_table, from_column, to_table, options = {}) to_column = options.fetch(:to_column, 'id') suffix = options[:suffix] on_delete = options[:delete] on_update = options[:update] on_delete = 'SET NULL' if on_delete == :set_null on_update = 'CASCADE' if on_update == :cascade constraint_name = "fk_#{from_table}_#{to_table}" constraint_name += "_#{suffix}" unless suffix.nil? sql = "ALTER TABLE #{from_table} ADD CONSTRAINT #{constraint_name} FOREIGN KEY (#{from_column}) REFERENCES #{to_table}(#{to_column})" sql += "\nON DELETE #{on_delete}" if on_delete sql += "\nON UPDATE #{on_update}" if on_update execute sql end def remove_foreign_key(from_table, to_table, suffix = nil) constraint_name = "fk_#{from_table}_#{to_table}" constraint_name += "_#{suffix}" unless suffix.nil? # note, you may have to use DROP KEY here - see MySQL docs for details...

Full article: http://pivotallabs.com/users/jdean/blog/articles/1707-usi...

Tweets

Finally tracked down the "An error occurred"-bu...

pivotallabs.com 28 Mar '12, 3pm

My pair and I were recently working on an app that asynchronously loaded the Facebook Javascript SDK but synchronously loa...

Introducing Bloggy: A simple way to add a Jekyll blog to any Rails application

Introducing Bloggy: A simple way to add a Jekyl...

engineyard.com 31 Mar '12, 9pm

We have been working hard on making RVM rock-solid, and to prevent regressions while simultaneously fixing and improving i...

Sam Ruby: Keeping it on the Rails

intertwingly.net 28 Mar '12, 9pm

The previous error that was caught was connection pool of new applications have size 1 . This demonstrates the unique valu...

Blog Archive » A Singapore Connection for two foreign artists

Blog Archive » A Singapore Connection for two f...

yesterday.sg 01 Apr '12, 3am

is showcasing North American artists Ms. Nadia Bertrand ’s and Ms. Janette Maxey ’s debut and joint art exhibition in Sing...

Rails 3.0’s ActiveModel: How To Give Ruby Class...

rubyinside.com 29 Mar '12, 1pm

In extracting the model-building parts of ActiveRecord, ActiveModel makes it possible to add model-like behavior to any Ru...

[railscasts] Upgrading to Rails 3.2

railscasts.com 01 Apr '12, 9am

Rails 3.2 sports many new features including automatic explain queries, tagged logging, key-value store in Active Record, ...

How to Host Hudson CI on AppCloud | Engine Yard Ruby on Rails Blog:

How to Host Hudson CI on AppCloud | Engine Yard...

engineyard.com 30 Mar '12, 9am

Post updated to reflect name change from Hudson CI to Jenkins CI Continuous Integration (CI) must be easy, easier to do, t...

Ruby Best Practices - Rails Modularity for Lazy...

blog.rubybestpractices.com 28 Mar '12, 4am

Rails Modularity for Lazy Bastards 2009-04-16 04:31, written by Gregory Brown When we develop standalone systems or work o...

“Capistrano 入門 - Ruby on Rails with OIAX”

“Capistrano 入門 - Ruby on Rails with OIAX”

oiax.jp 29 Mar '12, 12pm

Capistrano とは何か。それは、デプロイメントのツールである。 デプロイメントとは何か。Web アプリケーションについて言えば、それは以下のようなタスク全般を指す言葉である。 アプリケーションを本番サーバにインストールすること。あるいは...

Am I missing something or is this page laughabl...

guides.rubyonrails.org 01 Apr '12, 2am

The very first parameter, a string, is the text of the link which appears on the page. The second parameter, the options h...

Classy fashionable necklaces using lilypad

Classy fashionable necklaces using lilypad

arduino.cc 29 Mar '12, 6pm

Classy fashionable necklaces using lilypad Fashionable Technology Performance_ Interactive Necklace from Sylvia Yang on Vi...

A must-read blog for every Javascript and Ruby ...

yehudakatz.com 11 Apr '12, 12pm

A little over a year ago, I got my first serious glimpse at SproutCore, the JavaScript framework Apple used to build Mobil...

14 Bare Minimum Security Checks Before Releasin...

railsinside.com 30 Mar '12, 1am

When you upload your latest app to a production Web server and open it up to the world, you're really throwing your app to...

Browse Ruby on Rails documentation - APIdock:

apidock.com 03 Apr '12, 9am

ActionController::Routing::Optimisation::PositionalArgumentsWithAdditionalParams

10 websites built using ruby on rails

10 websites built using ruby on rails

railshosting.org 24 Mar '12, 10pm

The top 10 websites built with Ruby on Rails Posted by Collin on 05/19/2011 in Rails Tutorials . Ruby is a growing force i...