-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24926ea
commit 9d8a8f4
Showing
4 changed files
with
7 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
class ApplicationController < ActionController::Base | ||
include DeviseTokenAuth::Concerns::SetUserByToken | ||
protect_from_forgery with: :null_session, if: ->{request.format.json?} | ||
before_action :set_paper_trail_whodunnit | ||
protect_from_forgery with: :null_session | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
class User < ActiveRecord::Base | ||
# Include default devise modules. Others available are: | ||
# :confirmable, :lockable, :timeoutable and :omniauthable | ||
has_paper_trail | ||
devise :database_authenticatable, :registerable, | ||
:recoverable, :rememberable, :trackable, :validatable | ||
include DeviseTokenAuth::Concerns::User | ||
|
||
mount_uploader :avatar, ImageUploader | ||
validates :name, presence: true | ||
validates :username, uniqueness: true | ||
has_paper_trail | ||
validates :username, presence: true, uniqueness: true | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters