I'm trying to write an acts_as_ plugin for my rails app, and I need to override valid? and update_attributes. No matter what I do, I can't get it to call my plugin methods, but it will call my method_missing fine.
-from acts_as_option_record.rb module ActsAsOptionRecord def self.included(base) base.extend ClassMethods base.extend InstanceMethods end
module ClassMethods def acts_as_option_record include ActsAsOptionRecord::InstanceMethods extend ActsAsOptionRecord::ClassMethods end
end
module InstanceMethods
def update_attributes (arguments) debugger #stuff end
def valid? debugger #more stuff end end end
-from init.rb ActiveRecord::Base.send(:include, ActsAsOptionRecord)