aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-02 15:12:32 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-02 15:28:50 -0700
commit07d522b1bee0cec428c332ac8b7099a737f7ea35 (patch)
treeeb9a5297d3ecbbd8f4334823ff32929e1a93cb5f /activerecord
parent32bacb1ce80a06f328a0f32ca27c07d8417704bc (diff)
downloadrails-07d522b1bee0cec428c332ac8b7099a737f7ea35.tar.gz
rails-07d522b1bee0cec428c332ac8b7099a737f7ea35.tar.bz2
rails-07d522b1bee0cec428c332ac8b7099a737f7ea35.zip
get the name from the reflection
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb b/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb
index 55ec3bf4f1..abe6357185 100644
--- a/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb
+++ b/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb
@@ -10,7 +10,7 @@ module ActiveRecord::Associations::Builder
def define_callbacks(model, reflection)
super
- name = self.name
+ name = reflection.name
model.send(:include, Module.new {
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def destroy_associations