2014-02-17 12:05:39 -05:00
|
|
|
module ApiKeys
|
2014-06-29 16:21:27 -04:00
|
|
|
def api_index(channel_id)
|
2014-02-17 12:05:39 -05:00
|
|
|
if current_user && !current_user.channels.find_by_id(channel_id).nil?
|
|
|
|
@channel = current_user.channels.find(channel_id)
|
|
|
|
end
|
2014-06-29 16:21:27 -04:00
|
|
|
if current_user.present? && @channel.present? && current_user.id == @channel.user_id
|
2014-02-17 12:05:39 -05:00
|
|
|
@write_key = @channel.api_keys.write_keys.first
|
|
|
|
@read_keys = @channel.api_keys.read_keys
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2014-06-29 16:21:27 -04:00
|
|
|
|