mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Add user
This commit is contained in:
parent
b9229626e2
commit
df2deb3e0c
2
app/models/user.rb
Normal file
2
app/models/user.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class User < ActiveRecord::Base
|
||||
end
|
||||
12
db/migrate/20151023163642_create_users.rb
Normal file
12
db/migrate/20151023163642_create_users.rb
Normal file
@ -0,0 +1,12 @@
|
||||
class CreateUsers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :users do |t|
|
||||
t.string :email
|
||||
t.string :password_digest, limit: 60
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :users, :email, unique: true
|
||||
end
|
||||
end
|
||||
47
db/schema.rb
47
db/schema.rb
@ -11,54 +11,54 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20151022110802) do
|
||||
ActiveRecord::Schema.define(version: 20151023163642) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "categories", force: true do |t|
|
||||
t.string "name"
|
||||
create_table "categories", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.text "description"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "photo_id"
|
||||
t.string "base_colour"
|
||||
t.string "base_colour", limit: 255
|
||||
t.integer "sort"
|
||||
t.string "slug"
|
||||
t.string "slug", limit: 255
|
||||
end
|
||||
|
||||
create_table "categories_photos", id: false, force: true do |t|
|
||||
create_table "categories_photos", id: false, force: :cascade do |t|
|
||||
t.integer "category_id"
|
||||
t.integer "photo_id"
|
||||
end
|
||||
|
||||
add_index "categories_photos", ["category_id", "photo_id"], name: "index_categories_photos_on_category_id_and_photo_id", unique: true, using: :btree
|
||||
|
||||
create_table "pages", force: true do |t|
|
||||
t.string "name"
|
||||
t.string "title"
|
||||
create_table "pages", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "title", limit: 255
|
||||
t.text "content"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "photos", force: true do |t|
|
||||
t.string "flickr_url"
|
||||
create_table "photos", force: :cascade do |t|
|
||||
t.string "flickr_url", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "title"
|
||||
t.string "title", limit: 255
|
||||
t.text "description"
|
||||
t.integer "sort"
|
||||
t.boolean "featured", default: false
|
||||
t.boolean "enabled", default: true
|
||||
t.boolean "featured", default: false
|
||||
t.boolean "enabled", default: true
|
||||
t.datetime "taken_at"
|
||||
t.integer "views", default: 0
|
||||
t.string "image_uid"
|
||||
t.string "image_name"
|
||||
t.integer "views", default: 0
|
||||
t.string "image_uid", limit: 255
|
||||
t.string "image_name", limit: 255
|
||||
end
|
||||
|
||||
create_table "sessions", force: true do |t|
|
||||
t.string "session_id", null: false
|
||||
create_table "sessions", force: :cascade do |t|
|
||||
t.string "session_id", limit: 255, null: false
|
||||
t.text "data"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
@ -67,4 +67,13 @@ ActiveRecord::Schema.define(version: 20151022110802) do
|
||||
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
|
||||
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "email"
|
||||
t.string "password_digest", limit: 60
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
|
||||
|
||||
end
|
||||
|
||||
7
spec/factories/users.rb
Normal file
7
spec/factories/users.rb
Normal file
@ -0,0 +1,7 @@
|
||||
FactoryGirl.define do
|
||||
factory :user do
|
||||
email "test@example.com"
|
||||
password_digest ""
|
||||
end
|
||||
|
||||
end
|
||||
5
spec/models/user_spec.rb
Normal file
5
spec/models/user_spec.rb
Normal file
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe User, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user