Search code examples
ruby-on-railsactiverecordactive-relation

How to name the has_many thru join model between User and Blog?


I'm not a native english speaker, but if you are, how would you name this Rails ActiveRecord join model "???" in a semantic fashion?

User has_many :blogs, through: ???
User has_many ???

??? belongs_to :user
??? belongs_to :blog

Blog has_many :owners, class_name: 'User', through: ???
Blog has_many ???

Things like "Blogger" don't sound so well: User has_many :bloggers


Solution

  • I think I would go with 'authorships'. To me, 'bloggings' are the processes of writing to a blog. Of course, what matters is that the chosen word makes sense to you, since you're the one who needs to remember what it means when working with them.