Rails - Associations - Automatically setting an association_id for a model which has 2 belongs_to
- by adam
I have 3 models
class User < ...
belongs_to :language
has_many :posts
end
class Post < ...
belongs_to :user
belongs_to :language
end
class Language < ...
has_many :users
has_many :posts
end
Im going to be creating lots of posts via users and at the same time I have to also specify the language the post was written in,…