diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb | 25 |
1 files changed, 1 insertions, 24 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 8df7e7857f..b4537c5564 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 @@ -1,5 +1,5 @@ module ActiveRecord::Associations::Builder - class HABTM + class HasAndBelongsToMany # :nodoc: class JoinTableResolver KnownTable = Struct.new :join_table @@ -118,27 +118,4 @@ module ActiveRecord::Associations::Builder rhs_options end end - - class HasAndBelongsToMany < CollectionAssociation #:nodoc: - def macro - :has_and_belongs_to_many - end - - def valid_options - super + [:join_table, :association_foreign_key] - end - - def self.define_callbacks(model, reflection) - super - name = reflection.name - model.send(:include, Module.new { - class_eval <<-RUBY, __FILE__, __LINE__ + 1 - def destroy_associations - association(:#{name}).delete_all - super - end - RUBY - }) - end - end end |