I think you have some of the rough ideas correct.

Regarding the speaker and sermon. You only need HABTM between speaker and 
sermon if a sermon has more than one speaker. Otherwise you can use the 
regular has_many. But you seem to have a grasp of this so you may realize 
this.

Also for topics you may want to use a Rails tagging gem instead of your own 
topic model. You can investigate this one which the most 
popular: https://github.com/mbleigh/acts-as-taggable-on

Also you have the fields incorrect for your HABTM. in a HABTM association 
the id table will be separate.

This is an image which was very helpful for 
me: 
https://dl.dropboxusercontent.com/u/766146/ruby-on-rails-data-relationships.png

Ankur

On Wednesday, February 11, 2015 at 12:19:35 PM UTC-5, Brian Scramlin wrote:
>
> Greetings RoR Friends! I would SO APPRECIATE your help with a question. I 
> have read the Rails Guides, Stack Overflow, and tutorials but still seem to 
> fail at grasping some basic RoR Association Conventions.
>
> I will share with you the gist of the project layout and a picture of my 
> models and associations. Please let me know if this is correct. Especially 
> if the "has_and_belongs_to_many is reduntant.
>
> Overview: A web application where a church profile can be logged into by 
> multiple users. These users will upload sermons which can be viewed from 
> the church profile. The church profile categorizes the sermons based on 
> either the speaker, a series, or a topic. That's it! 
>
> Here is a picture of my models. Is this the correct way?
>
>
> <https://lh6.googleusercontent.com/-ShoGNdfI3nY/VNuPHt5I19I/AAAAAAAAAKw/Y3Y3gu2SZWY/s1600/SermonSpace%2BModels.jpg>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/6b73ccf7-9f6b-4cd2-881a-cb18a739f7c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to