On 18 May 2010 16:41, chewmanfoo <[email protected]> wrote:
> if you use a
> database to create the list, then you necessarily have to reference
> their position get to them

No - you reference their "primary key". This does not equate (unless
you have a *very* bad approach to DB design) to position.

> but if you define the list with, say, a
> yml file, then position is irrelevant.

No - again. If you have a yaml data source, you're probably going to
be storing a string value for the object. Exactly the same as if you'd
stored the string description (assuming the field was called
"description") of a db-table record. Absolutely no reference to
"position" is given.

> So, you can alter the list at
> will without having to worry about the consequences for objects which
> reference the list - you just can't delete an item in the list.

If you're worried about referential integrity, then check for it
before allowing records to be deleted.

I have a strong feeling, Chewmanfoo, that you aren't grasping some of
the fundamental principles of SQL, and using relational databases to
store representations of objects.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to