I think that the relationships in my model are OK so far. In my concrete 
case, an instance of A would be a  so-called (domain-specific) user 
dictionaries. An instance of B would be a dictionary entry (each 
dictionary has many entries). A C would be a so called idiom 
description, i.e. explaining the associated B object in different ways. 
Hence, each entry would contain several idioms.

The idiom description has among their columns are two fields which are 
called "representation" and "kind". In theory, the catenated key of 
"representation" and "kind" must be unique within a dictionary 
(different dictionaries may have the same [representation,kind] pair 
though). For the discussion of this posting, I didn't mention the 
presence of the "kind" column, since it just complicates the fact, and 
is not really important here for various reasons.

I could add to C a foreign key to A, and then express my validation with 
the help of this key, but it seems to me pointless to introduce a new 
column only for this purpose.

I am aware that I could do a custom validation, but I thought that the 
case my case is commonplace, that Rails maybe has some built-in feature 
for this which I just am not aware of.


Ronald

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5b8fee138a78d205d25ccfe8950bf8a3%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to