Undefined method "add_reference"


I try to add a foreign key in one of my rails migrations in the
following way:

def self.up
add_reference :categories, :items

This, strangely, leads to the following error during the migration:

– add_reference(:categories, :items)
rake aborted!
undefined method `add_reference’ for #

In the same way fails the code:

def self.up
change_table :categories do |t|
t.references :items

I recently upgraded to Rails 2.1.2, if this is relevant to my case. Does
anyone have any pointers on how to solve this problem?

Thanks in advance!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs