diff --git a/app/controllers/links_controller.rb b/app/controllers/links_controller.rb index bbb9195..a01c2b4 100644 --- a/app/controllers/links_controller.rb +++ b/app/controllers/links_controller.rb @@ -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 } diff --git a/app/models/link.rb b/app/models/link.rb index 7620654..6df742d 100644 --- a/app/models/link.rb +++ b/app/models/link.rb @@ -17,6 +17,8 @@ class Link < ActiveRecord::Base link.increment!(:visits) end + return false if link.release == nil + return link end end