From d52b538398eda382f9e2d24e1d6bbcddd4f04d67 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sat, 25 May 2024 14:44:32 +0200 Subject: [PATCH] Add link to api rocs --- app/views/devise/registrations/_api_key.html.erb | 2 ++ db/data/20240525110530_bind_existing_points_to_first_user.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/views/devise/registrations/_api_key.html.erb b/app/views/devise/registrations/_api_key.html.erb index ee535d59..21b81963 100644 --- a/app/views/devise/registrations/_api_key.html.erb +++ b/app/views/devise/registrations/_api_key.html.erb @@ -2,6 +2,8 @@

Use this API key to authenticate your requests.

<%= current_user.api_key %>

+

Docs: <%= link_to "API documentation", '/api-docs', class: 'underline hover:no-underline' %>

+ Usage example:
diff --git a/db/data/20240525110530_bind_existing_points_to_first_user.rb b/db/data/20240525110530_bind_existing_points_to_first_user.rb index 21fab9a4..3f86e437 100644 --- a/db/data/20240525110530_bind_existing_points_to_first_user.rb +++ b/db/data/20240525110530_bind_existing_points_to_first_user.rb @@ -4,6 +4,8 @@ class BindExistingPointsToFirstUser < ActiveRecord::Migration[7.1] def up user = User.first + return if user.blank? + points = Point.where(user_id: nil) points.update_all(user_id: user.id)