Skip to content

Commit

Permalink
Merge pull request #822 from projecthydra/refactor-habtm
Browse files Browse the repository at this point in the history
Removing dead define_destroy_hook method
  • Loading branch information
jcoyne committed Jun 24, 2015
2 parents 1d7c819 + c2b775b commit 2af40eb
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions lib/active_fedora/associations/builder/has_and_belongs_to_many.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,5 @@ def validate_options
end
end

def build
reflection = super
define_destroy_hook
reflection
end

private

def define_destroy_hook
# Don't use a before_destroy callback since users' before_destroy
# callbacks will be executed after the association is wiped out.
# TODO Update to destroy_associations
name = self.name
model.send(:include, Module.new {
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def destroy # def destroy
#{name}.clear # posts.clear
super # super
end # end
RUBY
})
end

end
end

0 comments on commit 2af40eb

Please sign in to comment.