Skip to content

Instantly share code, notes, and snippets.

@ianterrell
Created May 14, 2009 15:46
Show Gist options
  • Save ianterrell/111725 to your computer and use it in GitHub Desktop.
Save ianterrell/111725 to your computer and use it in GitHub Desktop.
class Book extends ActiveRecordModel {
static $belongs_to = array(
array('publisher'),
array('author', 'readonly' => true, 'select' => 'name', 'conditions' => "name != 'jax'"),
array('another', 'class_name' => 'SomeModel')
);
static $has_many = array(
array('revisions'),
array('editors', 'through' => 'revisions')
);
static $has_one = array(
array('something')
);
static $validates_length_of = array(
array('title', 'within' => array(1, 5))
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment