Skip to content

[skip ci] Add examples for has_{one,many} :through :source and :source_type#35612

Merged
eileencodes merged 2 commits intorails:masterfrom
imtayadeway:docs/has-many-through-source
Apr 3, 2019
Merged

[skip ci] Add examples for has_{one,many} :through :source and :source_type#35612
eileencodes merged 2 commits intorails:masterfrom
imtayadeway:docs/has-many-through-source

Conversation

@imtayadeway
Copy link
Contributor

Summary

I've often been confused about source and source_type. I thought it would be helpful to provide some examples here.

@rails-bot rails-bot bot added the docs label Mar 14, 2019
@imtayadeway imtayadeway force-pushed the docs/has-many-through-source branch 2 times, most recently from a126de6 to c9e9feb Compare March 18, 2019 17:20
@imtayadeway
Copy link
Contributor Author

@vipulnsward removed the source-only examples (as source is used in all the examples here) as suggested and updated the example in c9e9feb to something perhaps a bit more realistic. LMK if you have any other suggestions. Thanks!

Copy link
Member

@eileencodes eileencodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this over I think it's a good idea to document but we should use the same example for all the docs. In this file we use accounts, books, and now health insurance plans and doctor specialities. I think we should use books - it's simple to understand and translate and doesn't rely on understanding differences of our health insurance systems.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a different example? I think that health care plan is confusing for non-US readers. Even US folks may not understand the difference between PPO and high deductible plan. I have one and had to look up "HDHP". 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileencodes I'd be really happy to. My first thought was to extend one of the existing example domains, but I had the hardest time coming up with a polymorphic has_one :through example that made sense. I totally agree that the one I settled on is not very obvious/accessible. I'll give this some more thought, though I'd happily take a suggestion!

@imtayadeway imtayadeway force-pushed the docs/has-many-through-source branch from c9e9feb to ba6f64d Compare April 3, 2019 16:27
@imtayadeway
Copy link
Contributor Author

@eileencodes thanks for your patience! I updated both examples to use the books domain - I hope that they make sense! Happy to accommodate any further suggestions 😄

Copy link
Member

@eileencodes eileencodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these examples much better thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants