Hi pafahim,

   When you use HABM association in your models It will not generate the
join table automatically. We have to create manually.

  For your issue try to rollback the join table from database.

Thanks & Regards,
  VIjay

On Fri, Sep 21, 2012 at 3:51 PM, Fahim Patel <pafa...@gmail.com> wrote:

> I have two models cow and milkman.
> I am using has_and_belongs_to_many in both models .
> By mistake i have deleted cows_milkmans table from database.
>
> When i use  this command i am getting error
> a = Cow.last
> a.milkmans  #  when i fire this command then i am getting error that
> cows_milkmans table not exist
>
> As per my knowledge has_and_belongs_to_many will create third table
> automatically , no migration is needed.
>
> How can get that table ?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/UST5imVYvwMJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to