I think this is the original polyamorous code that works up to and including Rails 4.0 with just the one conditional.