Displaying 1 result from an estimated 1 matches for "admin_tab1_priv".
2010 Dec 30
3
rake db:seed with has_many through (m:n with seperate table)
...he relation is stored in a
seperate table sharedtabs (that contains some extra fields).
Between tabs and tasks there is a 1:n relation.
I have trouble writing my seed.rb:
works: (1)
tab = Tab.create(:name => ''Admin'', :category => 0)
tab.tasks.create(:name => ''Admin_Tab1_Private Task 1'')
works: (2)
User.create(:email => ''foo'', :password => ''bar'')
Tab.create(:name => ''Admin'', :category => 0)
Sharedtab.create(:user_id => 1, :tab_id => 1, :owner => true)
works: (3)
@user = User.create...