Skip to content

Instantly share code, notes, and snippets.

@JeanMertz
Created September 8, 2011 15:38
Show Gist options
  • Select an option

  • Save JeanMertz/1203706 to your computer and use it in GitHub Desktop.

Select an option

Save JeanMertz/1203706 to your computer and use it in GitHub Desktop.
# == Schema Information
#
# Table name: pages
#
# id :integer not null, primary key
# published :boolean default(FALSE)
# theme_id :integer
# parent_id :integer
# created_at :datetime
# updated_at :datetime
#
class Page < ActiveRecord::Base
belongs_to :theme
delegate :website, to: :theme
validates :name, uniqueness: { scope: [:website_id, :parent_id], case_sensitive: false }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment