Okay, let's assume I have two database tables, pages and sections. Each page belongs to a section. Each section cannot have two pages with the same filename. Let's assume this is my page model class:
Code:
class Page < ActiveRecord::Base
  validates_uniqueness_of 	:filename

  validates_presence_of 	:page_title
  validates_presence_of		:page_content
end
Now, my "validates_uniqueness_of" constraint somewhat works, but for example I can only have one page named "index" regardless of how many sections I have. How would I enforce the rule that the combination of section_id and filename must be unique, rather than just one or the other?