Generating an API key would be something along the lines of:
user = ...
api_key = ApiKey.new
api_key.created_by = user
api_key.user = user
api_key.save!
And then you can get the key with api_key.key
Generating an API key would be something along the lines of:
user = ...
api_key = ApiKey.new
api_key.created_by = user
api_key.user = user
api_key.save!
And then you can get the key with api_key.key