Skip to content

Commit

Permalink
Created a User model
Browse files Browse the repository at this point in the history
  • Loading branch information
mhartl committed Aug 22, 2010
1 parent af4b32e commit ff5ec33
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

group :development do
gem 'rspec-rails', '2.0.0.beta.18'
gem 'annotate-models'
end

group :test do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GEM
activemodel (= 3.0.0.rc)
activesupport (= 3.0.0.rc)
activesupport (3.0.0.rc)
annotate-models (1.0.4)
arel (0.4.0)
activesupport (>= 3.0.0.beta)
builder (2.1.2)
Expand Down Expand Up @@ -87,6 +88,7 @@ PLATFORMS
ruby

DEPENDENCIES
annotate-models
rails (= 3.0.0.rc)
rspec (= 2.0.0.beta.18)
rspec-rails (= 2.0.0.beta.18)
Expand Down
15 changes: 15 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# == Schema Information
# Schema version: 20100821203213
#
# Table name: users
#
# id :integer not null, primary key
# name :string(255)
# email :string(255)
# created_at :datetime
# updated_at :datetime
#

class User < ActiveRecord::Base
attr_accessible :name, :email
end
14 changes: 14 additions & 0 deletions db/migrate/20100821203213_create_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :name
t.string :email

t.timestamps
end
end

def self.down
drop_table :users
end
end
22 changes: 22 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20100821203213) do

create_table "users", :force => true do |t|
t.string "name"
t.string "email"
t.datetime "created_at"
t.datetime "updated_at"
end

end
5 changes: 5 additions & 0 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'spec_helper'

describe User do
pending "add some examples to (or delete) #{__FILE__}"
end

0 comments on commit ff5ec33

Please sign in to comment.