Я создаю Rails 3.0.3 камень и не могу заставить его работать:Простой Railtie Расширение Active Record
# 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 < Rails::Railtie
initializer 'attached.initialize' do
ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.send :include, Attached
end
end
end
end
Я получаю undefined local variable or method 'acts_as_fail'
, когда я добавить acts_as_fail
к любому из моих ActiveRecord
моделей. Пожалуйста помоги! Я очень расстроен этим, казалось бы, тривиальным кодом! Благодаря!
Частное лицо ладонь ... Большое спасибо Райан! – 2010-11-23 09:04:22