Skip to content
Permalink
Browse files

FIX: Update api_key rake task for recent changes

New usage: 

```
rake api_key:get_or_create_master["Onboarding Key"]
```
  • Loading branch information...
pfaffman authored and davidtaylorhq committed Nov 8, 2019
1 parent 920f8c6 commit 63bd07492ea07a999d8359409a0ea4000bce364f
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/tasks/api.rake
@@ -1,8 +1,9 @@
# frozen_string_literal: true

desc "generate api key if missing, return existing if already there"
task "api_key:get" => :environment do
api_key = ApiKey.create_master_key
desc "find or generate a master api key with given description"
task "api_key:get_or_create_master", [:description] => :environment do |task, args|
raise "Supply a description for the key" if !args[:description]
api_key = ApiKey.find_or_create_by!(description: args[:description], revoked_at: nil, user_id: nil)

puts api_key.key
puts api_key.key
end

1 comment on commit 63bd074

@discoursebot

This comment has been minimized.

Copy link

discoursebot commented on 63bd074 Nov 8, 2019

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/rake-api-key-get-broken/132948/11

Please sign in to comment.
You can’t perform that action at this time.