Skip to content

Instantly share code, notes, and snippets.

@ianterrell
Created May 14, 2009 15:47
Show Gist options
  • Save ianterrell/111728 to your computer and use it in GitHub Desktop.
Save ianterrell/111728 to your computer and use it in GitHub Desktop.
class Book < ActiveRecord::Base
belongs_to :publisher
belongs_to :author, :select => [:id, :name], :conditions => "name != 'jax'"
belongs_to :another, :class_name => "SomeModel"
has_many :revisions
has_many :editors, :through => :revisions
has_one :something
validates_length_of :title, :within => 1..5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment