In message <[EMAIL PROTECTED]>
Christopher Schmidt <[EMAIL PROTECTED]> wrote:
> Is there a way to select a specific version of an old way?
Several ;-) As things stand you could do:
OldWay.find(:first, :conditions => ["id = ? and version = ?", id, version])
but as I said the other day, it would be better to declare the
primary key for that model properly now we have the composite
keys plugin. So add:
set_primary_keys :id, :version
to the top of the model, then you can do:
OldWay.find(id, version)
> In Django, I'd do something akin to:
>
> old_way = OldWay.objects.get(id=23931312, version=1)
>
> I don't know what the Rails equivilant is. Anyone know?
>
> (Is there a tutorial I should read on Rails to answer this?)
Lots probably, but this is an unusual case as it involves a composite
primary key which rails doesn't natively support...
Tom
--
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu/
_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev