Skip to content

Instantly share code, notes, and snippets.

View dpickett's full-sized avatar

Dan Pickett dpickett

View GitHub Profile
Dir.chdir "#{RAILS_ROOT}/app/models/" do
Dir["**/*.rb"].each do |filename|
open(filename) do |file|
begin
if file.grep(/^\s+is_indexed/).any?
filename = filename[0..-4]
begin
Dir.chdir "#{RAILS_ROOT}/app/models/" do
Dir["**/*.rb"].each do |filename|
open(filename) do |file|
begin
if file.grep(/^\s+is_indexed/).any?
filename = filename[0..-4]
begin
class Condition < ActiveRecord::Base
include Dxj::SearchSubject
has_many :diagnoses
validates_uniqueness_of :name
validates_presence_of :name
end
is_indexed if false
include Dxj::SearchSubject
class ActionView::TestCase
# Enable UrlWriter when testing helpers
include ActionController::UrlWriter
# Default host for helper tests
default_url_options[:host] = 'localhost'
end
class ActionView::TestCase
class TestController < ActionController::Base
attr_accessor :request, :response, :params
def initialize
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
#Hack Hack Hack: TestCase doesn't have context of a current url so cheat a bit
@params = {}
module FindBySqlHater
def find_by_sql(*args)
raise "wtf are you thinking?!? use find k thx"
end
end
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
class FooHelperTest < ActionView::TestCase
end
def method_missing(name, *args)
if current_state.events(name)
process_event!(name, *args)
elsif name.to_s[-1].chr == '?' and states(name.to_s[0..-2].to_sym)
current_state == states(name.to_s[0..-2].to_sym)
else
super
end
end
Dan Pickett, http://en.oreilly.com/rails2009/profile/46469
Brian Cardarella, http://en.oreilly.com/rails2009/profile/45790
Nick Plante, http://en.oreilly.com/rails2009/profile/2753