maxlapshin / single_primary_key

Unique ID through all models

This URL has Read+Write access

name age message
file README Tue Sep 16 03:44:11 -0700 2008 initial commit [maxlapshin]
file init.rb Tue Sep 16 03:44:11 -0700 2008 initial commit [maxlapshin]
directory lib/ Sat Sep 27 04:45:26 -0700 2008 sequence sometimes is lost in Story runner [maxlapshin]
README
Author: Max Lapshin <max@maxidoors.ru>

This plugin maintains unique primary key ID through ALL of your models

1. ./script/plugin install git://github.com/maxlapshin/single_primary_key.git
2. ./script/generate migration single_id
3. Replace contents of migration class with extend SinglePrimaryKey::Migration, i.e.:

class SingleId < ActiveRecord::Migration
  extend SinglePrimaryKey::Migration
end

4. rake db:migrate
5. voila! MySQL and Postgres now will have unique ID. Thus you can safely use LEFT JOIN with
polymorpic associations.