This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Condition < ActiveRecord::Base | |
include Dxj::SearchSubject | |
has_many :diagnoses | |
validates_uniqueness_of :name | |
validates_presence_of :name | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is_indexed if false | |
include Dxj::SearchSubject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActionView::TestCase | |
# Enable UrlWriter when testing helpers | |
include ActionController::UrlWriter | |
# Default host for helper tests | |
default_url_options[:host] = 'localhost' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FindBySqlHater | |
def find_by_sql(*args) | |
raise "wtf are you thinking?!? use find k thx" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper') | |
class FooHelperTest < ActionView::TestCase | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |