Skip to content

Instantly share code, notes, and snippets.

@brennon
Created September 11, 2010 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brennon/575593 to your computer and use it in GitHub Desktop.
Save brennon/575593 to your computer and use it in GitHub Desktop.
class Widget < ActiveRecord::Base
has_one :framework
end
class Framework < ActiveRecord::Base
belongs_to :widget
has_one :detail, :polymorphic => true
end
class InformationalFramework < ActiveRecord::Base
belongs_to :framework, :as => :detail
end
class OneWayCommunicationFramework < ActiveRecord::Base
belongs_to :framework, :as => :detail
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment