2
我不是英语母语的人,但如果你是,你会如何命名这个Rails ActiveRecord连接模型“???”以语义的方式?如何命名用户和博客之间的has_many通过连接模型?
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 ???
像“博客”不健全的那么好:用户的has_many:博主
不错!唯一的问题可能是与用户以类似方式链接的后续模型。 BlogAuthororship或BlogOwnership可以作为替代方案。 – svoop 2012-01-10 17:22:59
甚至是一个多态的所有权连接模型。 – svoop 2012-01-10 17:42:21