I have a Company
and Archive
model that have the same table structure. Both models have a validates :name, :uniqueness => true
validation.
In the company.rb file I'm having trouble setting up a custom validation where when I add a record to the Company
database it also checks the Archive
model (so that if a record in the Archive model with that name already exists then it won't be added to the Company
table).
I'm assuming this is possible to do, but I'm having trouble implementing, can anyone help?