diff options
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/association_proxy.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index c8d72c9f25..8245234854 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -2,7 +2,8 @@ module ActiveRecord module Associations class AssociationProxy #:nodoc: alias_method :proxy_respond_to?, :respond_to? - instance_methods.each { |m| undef_method m unless m =~ /(^__|^nil\?|^proxy_respond_to\?|^send)/ } + alias_method :proxy_extend, :extend + instance_methods.each { |m| undef_method m unless m =~ /(^__|^nil\?|^proxy_respond_to\?|^proxy_extend|^send)/ } def initialize(owner, association_name, association_class_name, association_class_primary_key_name, options) @owner = owner @@ -11,6 +12,8 @@ module ActiveRecord @association_class = eval(association_class_name, nil, __FILE__, __LINE__) @association_class_primary_key_name = association_class_primary_key_name + proxy_extend(options[:extend]) if options[:extend] + reset end @@ -95,4 +98,4 @@ module ActiveRecord end end end -end +end
\ No newline at end of file |