Ok, this is the tables create table statussir ( idstatussir primary key int auto_numeric, description varchar(255) ); create table statussir_next ( idstatussir int not null, idstatussir_next not null, foreign key idstatussir references statussir(id_statussir), foreign key idstatussir_next references statussir(id_statussir) ); so, the idea is that you have many states idstatussir description 1 Not Started 2 Assigned 3 In Planning 4 In Progress 5 Finished 6 Cancelled And then statussir_next tells you how can you pass to the next states Idstatussir idstatussir_next 1 2 1 6 2 3 2 6 3 4 3 6 4 5 4 6 I don?t know how to map that, I have class StatusSIR < ActiveRecord::Base #Table name and primary key set_table_name "statussir" set_primary_key "idstatussir" #Relations # What do I put here to map that relation????? End Thank you Rodrigo Dom?nguez Iplan Networs <http://www.iplan.com.ar/> www.iplan.com.ar ? <mailto:rdominguez@iplan.com.ar> rdominguez@iplan.com.ar <http://www.rorra.com.ar/> www.rorra.com.ar ? <mailto:rorra@rorra.com.ar> rorra@rorra.com.ar -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060129/f486d98f/attachment-0001.html