Topic: polymorphic associations too complicated for this?

In modelling Addresses in say streamlined's sample app.

Teams have billing and shipping address
coach has one address
Players have many addresses including main, off season, and possible alternates.

In generating a mailing label, Teams need the organization name as the first line.

The major benefit of STI is you can get a list of multiple types in one call.  Which is not useful for addresses (never ask for all addresses in system)

The only other benefit I can think of in a single address model/table is that all validations can be centralized, but there can be enough exceptions and cross class accessing (getting team name in some cases), that its not extra useful.

How would you model a need for common addresses?

Re: polymorphic associations too complicated for this?

This is the way I would do it for the example you gave:

class Team < ActiveRecord::Base
  has_one :billing_address, :as => :addressable
  has_one :shipping_address, :as => :addressable
end

class Coach < ActiveRecord::Base
  has_one :address, :as => :addressable
end

class Player < ActiveRecord::Base
  has_many :locations, :class_name => "PlayerLocations"
end

class PlayerLocation < ActiveRecord::Base
  belongs_to :player
  has_one :address, :as => :addressable
end

class Address < ActiveRecord::Base
  belongs_to :addressable, :polymorphic => true
end


STI would not factor in to my solution