On Tue, 01 Mar 2005 15:49:50 -0600, John-Mason P. Shackelford
<john-mason-Grinw8Jr/8zZYwk40xCobA@public.gmane.org>
wrote:> Greetings all,
>
> In looking at the API for ActiveRecord::Associations::ClassMethods there
> doesn''t appear to be a way to rename an association. In doing some
> refactoring I am replacing one table with two but want to preserve the
> old associations names, e.g. I want to be able to still say
> build_type.artifacts instead of having to use the new table name:
> build_type.build_type_artifacts. Is an alias my only option or am I
> missing something glaringly obvious?
No, it''s a little confusing at first. But I think the functionality
you''re looking for is there.
class BuildType < ActiveRecord::Base
has_and_belongs_to_many :anynameyouwant, :classname=>"Artifact"
end
> John-Mason Shackelford
>
> Software Developer
> Pearson Educational Measurement
>
> 2510 North Dodge St.
> Iowa City, IA 52245
> ph. 319-354-9200x6214
> john-mason.shackelford-uJfvbxoDSvxBDgjK7y7TUQ@public.gmane.org
> http://pearsonedmeasurement.com
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Cheers
Koz