rails插件

def self.included(base)
puts "add methods to ActiveRecord::Base"
base.send :include, InstanceMethods
base.extend(ClassMethods)
end

require 'case_insensitive'
ActiveRecord::Base.send :include, Model2

#此处include是回调上面的方法include方法

你可能感兴趣的:(Rails)