Hello, I am still trying to find a solution to this. Please feel free to throw any ideas at me or help me find the appropriate forum. Thank you V
On Jan 6, 12:55 pm, tron <[email protected]> wrote: > Dear List, > > This may not be rails unique but what is the best practice to validate > theuniquenessof has_many associations. > In particular the models are > > class Word > end > > class PhraseComponent > belongs_to :word > belongs_to :dictionary_entry > acts_as_list :scope => :dictionary_entry > end > > class DictionaryEntry > has_many :phrase_components > has_many :words, :through => :phrase_components > end > > Dictionary entries (words and phrases) are composed of words (which > are uniq) > and I want to check the same phrase occurs only once in the > DictionaryEntry table. > > Is there a better or more efficient way to do this than create and > update a footprint > of the word associations on dictionary entries? > This means I would have a string field in the dictionary_entries table > which is a concatenation of > the associated words and would check the uniquness of that. > > If we generalize the problem, we need to assureuniquenessof lists of > arbitrary objects (where a list is via a join table), in that case the > only representation that I can create on the list is the concatenation > of ids of list items and check theuniquenessof this? > I begin to think there must be a more canonical way to handle this. > Any help appreciated > > Viktor > > I found someone asking the same question but no reply followed. > > http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

