expose user's api key as api_token field on sessions

This commit is contained in:
r888888888
2019-10-07 13:54:52 -07:00
parent 4e630f50cc
commit 62a1aeabce
3 changed files with 24 additions and 7 deletions

View File

@@ -612,6 +612,10 @@ class User < ApplicationRecord
"created_at" => created_at.strftime("%Y-%m-%d %H:%M")
}.to_json
end
def api_token
api_key.try(:key)
end
end
module CountMethods