Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2010 21:33
Show Gist options
  • Save anonymous/270690 to your computer and use it in GitHub Desktop.
Save anonymous/270690 to your computer and use it in GitHub Desktop.
## I seem to have lost my base models - I had obtained them already from pre-existing tables.
Basically, this relates to one table, a model and a subclass, which I thought would be quite short.
class Person < ActiveRecord::Base
has_one :address
has_one :phone
belongs_to :district
end
class Member<Person
def
## The following line is the bit that I do not know how to do.
member?; mem == true
end
create_table "people", :force => true do |t|
t.integer "roll"
t.integer "district_id"
t.text "title"
t.text "forenames"
t.text "surname"
t.boolean "mem"
t.datetime "created_at"
t.datetime "updated_at"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment