Users create Programs. These can be followed/liked by other Users. However, the Program will ALWAYS have one creator.
So I need a ProgramsUsers table to map the like/follow. Would the “creator” also go as a type of relationship in that table, or could a Program also belongs_to a single specific User?
So in essence:
Program.rb
class Program < ActiveRecord::Base
has_and_belongs_to_many :users #Likes/Follows
belongs_to :user #Creator
Is this acceptable or is this poor modeling?
I believe you can do something like this
This way, you can have a
creator_idfield on yourprogramstable, and access it using@program.creator. Oh, and btw, it is not poor modeling.