My Recent Pastes (53 and counting)

All Pasties (over 53 and counting)

Pages: 1 3

Below are summaries of the 15 most recent pasties by Pat Allan.

September 01, 2007
2:36AM EDT
by Pat Allan

1
2
3
4
5
require "spec/spec_helper"

describe "Conditional Fragment Caching in the controller" do
  ActionController::Base.logger = Logger.new(STDOUT)
  

September 01, 2007
2:34AM EDT
by Pat Allan

1
2
3
4
5
require "spec/spec_helper"

describe "Conditional Action Caching" do
  before :all do
    FileUtils.mkdir_p(FILE_STORE_PATH)

September 01, 2007
2:33AM EDT
by Pat Allan

1
2
3
4
5
ENV["RAILS_ENV"] = "test"

require 'fileutils'
require 'action_controller'
require 'action_controller/test_process'

August 31, 2007
12:18AM EDT
by Pat Allan

1
2
3
4
5
module MixinModule
  def MixinModule.included?(mod)
    mod.class_eval do
      alias_method :default_render_file, :render_file
  

August 30, 2007
11:34PM EDT
by Pat Allan

1
2
3
4
5
module ActionController
  class Base
    alias_method :default_render_file, :render_file
  
    def render_file(whatever_params)

August 30, 2007
11:16PM EDT
by Pat Allan

1
2
3
4
5
module MixinModule
  alias_method :default_render_file, :render_file
  
  def render_file(whatever_params)
    # do my own thing here

August 29, 2007
8:44AM EDT
by Pat Allan

1
2
3
path = File.dirname(File.expand_path(__FILE__))
require "#{path}/lib/action_controller"
require "#{path}/lib/action_view"

August 28, 2007
8:37PM EDT
by Pat Allan

1
2
3
4
5
class Time
  def to_s
    "my new implementation"
  end
end

August 28, 2007
10:21AM EDT
by Pat Allan

1
2
3
4
5
# news/articles controllers

def show
  @article = Article.find(:first, :conditions => {:id => params[:id]})
  # send to 404 if @article is nil

August 28, 2007
9:53AM EDT
by Pat Allan

1
2
map.connect 'reviews/:letter',  :controller => 'reviews', :action => 'list', :letter => /^[a-z0]$/
map.connect 'reviews/:id',      :controller => 'reviews', :action => 'show', :id     => /^[1-9][0-9]*$/

August 22, 2007
9:34PM EDT
by Pat Allan

1
2
3
4
5
@trailers = Trailer.find(:all,
  :conditions => "title REGEXP '^(the |an |a )?[#{@letter}].*$' AND NOT title REGEXP 'a [^#{@letter}]'")

@trailers = Trailer.find(:all,
  :conditions => ["title REGEXP '^(the |an |a )?[:letter].*$' AND NOT title REGEXP 'a [^:letter]'", :letter => @letter])

August 17, 2007
3:20AM EDT
by Pat Allan

1
2
3
4
5
module ActionController
  class Base
    def self.caches_action(*actions, &block)
      return unless perform_caching
      around_filter(ActionCacheFilter.new(*actions, &block))

August 17, 2007
3:11AM EDT
by Pat Allan

1
2
3
4
5
module ActionController
  module Caching
    module Actions
      class ActionCacheFilter
        alias_method :default_before, :before

August 17, 2007
2:55AM EDT
by Pat Allan

1
2
3
4
5
module ActionController
  module Caching
    module Actions
      class ActionCacheFilter
        alias_method :default_before, :before

August 17, 2007
2:39AM EDT
by Pat Allan

1
2
3
4
5
module ActionController
  module Caching
    module Actions
      class ActionCacheFilter
        alias_method :default_before, :before

Next page

Previous page