svenfuchs
1/29/2009 - 1:39 PM

gistfile1.rb

ActionController::Routing::Routes.draw do |map|
  map.from_plugins
  map.filter 'force_html'
end
ActionController::Dispatcher.to_prepare do
  require 'application' # need to do this so we can access BaseController
  
  BaseController.class_eval do
    include UrlHistory::Tracking
    tracks_url_history
  end
  
  Content.class_eval do
    def update_url_history_params(params)
      if params.has_key?(:year)
        params.merge self.full_permalink
      elsif params.has_key?(:permalink)
        params.merge :permalink => self.permalink
      else 
        params
      end
    end
  end
end