Don't return a link if it has not been released.
This commit is contained in:
parent
eedd12c084
commit
87232d64ee
2 changed files with 2 additions and 2 deletions
|
@ -17,8 +17,6 @@ class LinksController < ApplicationController
|
|||
def show
|
||||
@link = Link.get_and_count(params[:id])
|
||||
|
||||
#if it's not released, need to error
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to @link.url }
|
||||
format.json { render :json => @link }
|
||||
|
|
|
@ -17,6 +17,8 @@ class Link < ActiveRecord::Base
|
|||
link.increment!(:visits)
|
||||
end
|
||||
|
||||
return false if link.release == nil
|
||||
|
||||
return link
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue