Don't return a link if it has not been released.

This commit is contained in:
Andrew Tomaka 2012-05-04 23:41:46 -04:00
parent eedd12c084
commit 87232d64ee
2 changed files with 2 additions and 2 deletions

View file

@ -17,8 +17,6 @@ class LinksController < ApplicationController
def show def show
@link = Link.get_and_count(params[:id]) @link = Link.get_and_count(params[:id])
#if it's not released, need to error
respond_to do |format| respond_to do |format|
format.html { redirect_to @link.url } format.html { redirect_to @link.url }
format.json { render :json => @link } format.json { render :json => @link }

View file

@ -17,6 +17,8 @@ class Link < ActiveRecord::Base
link.increment!(:visits) link.increment!(:visits)
end end
return false if link.release == nil
return link return link
end end
end end