Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
#73 add icon column to user model
Browse files Browse the repository at this point in the history
  • Loading branch information
Subarunari committed Dec 25, 2017
1 parent 2752969 commit b9e5ace
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class User < ApplicationRecord
# relations
has_many :games, dependent: :destroy

mount_uploader :icon, IconUploader

def self.new_token
SecureRandom.urlsafe_base64
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20171224150315_add_icon_to_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddIconToUsers < ActiveRecord::Migration[5.1]
def change
add_column :users, :icon, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20171214162123) do
ActiveRecord::Schema.define(version: 20171224150315) do

create_table "categories", force: :cascade do |t|
t.string "name"
Expand Down Expand Up @@ -80,6 +80,7 @@
t.datetime "updated_at", null: false
t.string "username", default: "", null: false
t.boolean "admin", default: false, null: false
t.string "icon"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
Expand Down

0 comments on commit b9e5ace

Please sign in to comment.