Simple Railtie Extension of Active Record <p>I'm creating a Rails 3.0.3 gem and can't get it to work:</p> <pre><code># attached.rb module Attached require 'attached/railtie' if defined?(Rails) def self.include(base) base.send :extend, ClassMethods end module ClassMethods def acts_as_fail end end end # attached/railtie.rb require 'attached' require 'rails' module Attached class Railtie &lt; Rails::Railtie initializer 'attached.initialize' do ActiveSupport.on_load(:active_record) do ActiveRecord::Base.send :include, Attached end end end end </code></pre> <p>I get <code>undefined local variable or method 'acts_as_fail'</code> when I add <code>acts_as_fail</code> to any of my <code>ActiveRecord</code> models. Please help! I'm extremely frustrated with this seemingly trivial code! Thanks!</p>