so basically I have two models:
class User < ActiveRecord::Base
has_and_belongs_to_many :post
end
class Post < ActiveRecord::Base
has_and_belongs_to_many :user
end
and my migration was:
rails g migration CreateJoinTablePostsUsers posts users
But in my console if I type:
@post = Post.where(:id => User.find_by_email("me@mail.com").post_ids).last
but I get nil instead
I checked in the terminal:
Post.last.user_ids
and:
User.last.post_ids
both of them returned empty