Wednesday 12 September 2012

unique Relationship


class Relationship < ActiveRecord::Base
  belongs_to :entry
  belongs_to :tag
  validates :tag_id, :uniqueness => { :scope => :entry_id }
end

No comments:

Post a Comment