discord: add /random command.
This commit is contained in:
@@ -88,7 +88,7 @@ class PostsController < ApplicationController
|
||||
end
|
||||
|
||||
def random
|
||||
@post = Post.user_tag_match(params[:tags]).random
|
||||
@post = Post.user_tag_match(params[:tags]).random(1).first
|
||||
raise ActiveRecord::RecordNotFound if @post.nil?
|
||||
authorize @post
|
||||
respond_with(@post) do |format|
|
||||
|
||||
Reference in New Issue
Block a user