Skip to content

Instantly share code, notes, and snippets.

@enricostano
Created August 3, 2012 13:35
Show Gist options
  • Save enricostano/3247748 to your computer and use it in GitHub Desktop.
Save enricostano/3247748 to your computer and use it in GitHub Desktop.
modelli
class Project < ActiveRecord::Base
attr_accessible :name, :start, :stop
belongs_to :institution
validates :name, :start, :stop, :presence => true
end
class Institution < ActiveRecord::Base
attr_accessible :email, :name, :phone
has_many :projects, :dependent => :destroy
validates :email, :name, :phone, :presence => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment