Skip to content
Browse files

User

  • Loading branch information...
1 parent 5968c80 commit 64c2cd259892000bdfa0fb35bf39cef37a5ee897 @gsterndale gsterndale committed Nov 22, 2011
Showing with 24 additions and 1 deletion.
  1. +3 −0 app/models/user.rb
  2. +11 −0 db/migrate/20111122142342_create_users.rb
  3. +10 −1 db/schema.rb
View
3 app/models/user.rb
@@ -0,0 +1,3 @@
+class User < ActiveRecord::Base
+ belongs_to :organization
+end
View
11 db/migrate/20111122142342_create_users.rb
@@ -0,0 +1,11 @@
+class CreateUsers < ActiveRecord::Migration
+ def change
+ create_table :users do |t|
+ t.references :organization
+ t.string :name
+
+ t.timestamps
+ end
+ add_index :users, :organization_id
+ end
+end
View
11 db/schema.rb
@@ -11,12 +11,21 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20111122142220) do
+ActiveRecord::Schema.define(:version => 20111122142342) do
create_table "organizations", :force => true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
end
+ create_table "users", :force => true do |t|
+ t.integer "organization_id"
+ t.string "name"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "users", ["organization_id"], :name => "index_users_on_organization_id"
+
end

0 comments on commit 64c2cd2

Please sign in to comment.
Something went wrong with that request. Please try again.