Ok, I''ve been messing with ror for a few days, but I''m stumped
here.
Here are my tables.
CREATE TABLE `steps` (
`id` int(10) unsigned NOT NULL auto_increment,
`step_infos_id` int(10) unsigned NOT NULL default ''0'',
`translator_id` int(10) unsigned NOT NULL default ''0'',
`Sequence` int(11) NOT NULL default ''0'',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `dt_test`.`step_infos`;
CREATE TABLE `step_infos` (
`id` int(10) unsigned NOT NULL auto_increment,
`Name` varchar(45) NOT NULL default '''',
`ClassName` varchar(100) NOT NULL default '''',
`Description` varchar(45) default NULL,
`InputFormat` varchar(45) NOT NULL default '''',
`OutputFormat` varchar(45) NOT NULL default '''',
`DocURL` varchar(45) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
what I want to do is provide a lookup. stepInfo is "metadata" that
rarely
changes. an instance of stepInfo can be used many times in steps. from step,
want to lookup by step_infos_id into step_infos so I can go step.StepInfo.Name,
etc.
class Step < ActiveRecord::Base
has_one :StepInfo
end
class StepInfo < ActiveRecord::Base
has_many :steps
end
this tries to put step table''s ID into stepinfo, which isn''t
what I want. I want
to lookup via stepInfoID from step...
any thoughts? I''m sure I''m missing something obvious...