class Foo < ActiveRecoed::Base
has_many :www_links, :as => :owner
class WwwLink < ActiveRecord::Base
belongs_to :owner, :polymorphic => true
I want to ensure that each Foo instance does not have same links (href).
My first attempt would be to write validation in Foo that checks all its
www_links. But then I would also have to do it in WwwLink class. That
would not be DRY.
Any other ideas?