Skip to content

Commit

Permalink
Created and annotated a user model
Browse files Browse the repository at this point in the history
  • Loading branch information
ketan21 committed Jun 27, 2012
1 parent fb2be99 commit b868694
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 12 deletions.
12 changes: 1 addition & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,20 @@ source 'https://rubygems.org'

gem 'rails', '3.2.2'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
gem 'spork'



# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'

gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

group :development do
gem 'rspec-rails', '2.10.0'
gem 'annotated-rails'
end

group :production do
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ GEM
activesupport (3.2.2)
i18n (~> 0.6)
multi_json (~> 1.0)
annotated-rails (0.0.2)
activerecord (>= 3.0.0)
arel (3.0.2)
builder (3.0.0)
coffee-rails (3.2.2)
Expand Down Expand Up @@ -124,6 +126,7 @@ PLATFORMS
ruby

DEPENDENCIES
annotated-rails
coffee-rails (~> 3.2.1)
jquery-rails
pg
Expand Down
16 changes: 16 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class User < ActiveRecord::Base
attr_accessible :name, :email
end
#--
# generated by 'annotated-rails' gem, please do not remove this line and content below, instead use `bundle exec annotate-rails -d` command
#++
# Table name: users
#
# * id :integer not null
# name :string(255)
# email :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#--
# generated by 'annotated-rails' gem, please do not remove this line and content above, instead use `bundle exec annotate-rails -d` command
#++
10 changes: 10 additions & 0 deletions db/migrate/20120615173258_create_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name
t.string :email

t.timestamps
end
end
end
9 changes: 8 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 0) do
ActiveRecord::Schema.define(:version => 20120615173258) do

create_table "users", :force => true do |t|
t.string "name"
t.string "email"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
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 b868694

Please sign in to comment.