From c8dd66fdcdc2170982fea8a1782c1728f79e3d41 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 6 Nov 2005 19:05:42 +0000 Subject: Made association extensions use simpler block syntax git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/reflection.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/reflection.rb') diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index de5a01c9be..affbb65ca6 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -21,12 +21,12 @@ module ActiveRecord base.module_eval <<-"end_eval" class << self alias_method :#{association_type}_without_reflection, :#{association_type} - - def #{association_type}_with_reflection(association_id, options = {}) - #{association_type}_without_reflection(association_id, options) + + def #{association_type}_with_reflection(association_id, options = {}, &block) + #{association_type}_without_reflection(association_id, options, &block) reflect_on_all_associations << AssociationReflection.new(:#{association_type}, association_id, options, self) end - + alias_method :#{association_type}, :#{association_type}_with_reflection end end_eval -- cgit v1.2.3