Hi Matthew Shapiro

      I think you are trying for uniq entry in join table(here 
relationship_topics).That you can do on db level In the migration file 
for this join table you can add after the creation of the table an index 
like

add_index :relationship_topics, [:relationship_id, :topic_id], :unique 
=> true

    Then migrate as usual.Now the model save can be run inside a begin 
end block
and rescue ActiveRecord::StatementInvalid  error..You can also remove 
the line

validates_uniqueness_of :topic, :scope => :relationship
    from above



Sijo
-- 
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 post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to