#---
# Excerpted from "Rails Recipes"
# We make no guarantees that this code is fit for any purpose. 
# Visit http://www.pragmaticprogrammer.com/titles/fr_rr for more book information.
#---
class FeedController < ApplicationController
  before_filter :authenticate_access_key, :only => [:inbox]
  def authenticate_access_key
    inbox = Inbox.find_by_access_key(params[:access_key])  
    if inbox.blank? || inbox.id != params[:id].to_i 
      raise "Nieuwierzytelniony"
    end
  end
  def inbox
    @inbox = Inbox.find(params[:id])
  end
end
