Skip to content

Repository files navigation

Objective

demo how to use polymorphic with has_many through at both side

Environment

rails 4.0.0
ruby 1.9.3

Core code relation

classArticle < ActiveRecord::Basehas_many:attachable_entities,as: :entityhas_many:attachables,through: :attachable_entities,source: :attachable,source_type: ImageendclassAttachableEntity < ActiveRecord::Basebelongs_to:entity,polymorphic: truebelongs_to:attachable,polymorphic: trueendclassImage < ActiveRecord::Basehas_many:attachable_entities,as: :attachablehas_many:entities,through: :attachable_entities,source: :entity,source_type: Articleend

About

show a polymorphic and has_many through

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages