Skip to content
Browse files

Add person model

  • Loading branch information...
1 parent 4c64704 commit 14f16ea5e93a8d5f70a1c87f8a8d4ec7302f8fa2 @Vanuan committed Jul 14, 2014
Showing with 55 additions and 0 deletions.
  1. +2 −0 app/models/person.rb
  2. +11 −0 db/migrate/20140714115420_create_people.rb
  3. +24 −0 db/schema.rb
  4. +11 −0 test/fixtures/people.yml
  5. +7 −0 test/models/person_test.rb
View
2 app/models/person.rb
@@ -0,0 +1,2 @@
+class Person < ActiveRecord::Base
+end
View
11 db/migrate/20140714115420_create_people.rb
@@ -0,0 +1,11 @@
+class CreatePeople < ActiveRecord::Migration
+ def change
+ create_table :people do |t|
+ t.string :name
+ t.date :date_of_birth
+ t.string :place_of_birth
+
+ t.timestamps
+ end
+ end
+end
View
24 db/schema.rb
@@ -0,0 +1,24 @@
+# encoding: UTF-8
+# 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 that you check this file into your version control system.
+
+ActiveRecord::Schema.define(version: 20140714115420) do
+
+ create_table "people", force: true do |t|
+ t.string "name"
+ t.date "date_of_birth"
+ t.string "place_of_birth"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+end
View
11 test/fixtures/people.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+one:
+ name: MyString
+ date_of_birth: 2014-07-14
+ place_of_birth: MyString
+
+two:
+ name: MyString
+ date_of_birth: 2014-07-14
+ place_of_birth: MyString
View
7 test/models/person_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class PersonTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end

0 comments on commit 14f16ea

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