Feature: Profile API [#238] (#354)

- api to update name and email
- api to change password
- api to  set profile pic
- fixes update_attribute! deprecation warning
- introducing active storage
This commit is contained in:
Sojan Jose
2019-12-10 10:29:35 +05:30
committed by Pranav Raj S
parent 7f96c39b18
commit 1abaee04d8
15 changed files with 177 additions and 10 deletions

View File

@@ -10,7 +10,6 @@
# current_sign_in_ip :string
# email :string
# encrypted_password :string default(""), not null
# image :string
# last_sign_in_at :datetime
# last_sign_in_ip :string
# name :string not null
@@ -60,6 +59,9 @@ class User < ApplicationRecord
# Used by the actionCable/PubSub Service we use for real time communications
has_secure_token :pubsub_token
# Uses active storage for the avatar
has_one_attached :avatar
# The validation below has been commented out as it does not
# work because :validatable in devise overrides this.
# validates_uniqueness_of :email, scope: :account_id