Code in polymorphic belongs_to obsolete?


I'm refactoring some code related to autosaving associations.
While doing this, I came across some code which doesn't seem to do anything, or rather, no tests fail when this code is disabled.

I tried to write a failing test:

   def test_case_name
     treasure = => 'gold')!

     treasure.looter = => 'yarr')!

     assert_equal 'Pirate', treasure.reload.looter_type

However, with the offending line of code removed the test still passes.
So it seems that the looter_type (:foreign_type) is being set from somewhere else before getting to the before_save callback.

If this code isn't necessary anymore it would clean up nicely, since the 2 belongs_to before_save callbacks are almost identical. So any info would be appreciated.