On 30 September 2011 05:49, Rob Biedenharn <Rob@agileconsultingllc.com> wrote:
> class File
> has_many :admins
> has_many :users, :through => :admins
> end
> class Admin
> belongs_to :file
> belongs_to :user
> end
> class User
> end
> You should not need an `id` on the admins table, but you almost certainly
> want to have an index on each of the `file_id` and `user_id` columns.
Are you sure? I've not got time to test it right now, but I was under
the impression you would need an id for the admins table unless the
model described it as the join table in a habtm?
class File
has_and_belongs_to_many :users, :join_table => "admins"
end
class User
has_and_belongs_to_many :files, :join_table => "admins"
end
File.first.users
etc
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
i'm following along with michael hartl's tutorial
(http://ruby.railstutorial.org/chapters/a-demo-app#top), creating a demo
app.
i pushed my app/db/data on to heroku (falling-sky-4350.heroku.com/), but
am getting an error
An error occurred in the application and your page could not be served.
Please try again in a few moments.
If you are the application owner, check your logs for details.
my heroku log is attached. can someone please help me to suss it out?
thanks.
Attachments:
http://www.ruby-forum.com/attachment/6643/heroku.error
--
Posted via http://www.ruby-forum.com/.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
i'm following along with michael hartl's tutorial
(http://ruby.railstutorial.org/chapters/a-demo-app#top), creating a demo
app.
i pushed my app/db/data on to heroku (falling-sky-4350.heroku.com/), but
am getting an error
An error occurred in the application and your page could not be served.
Please try again in a few moments.
If you are the application owner, check your logs for details.
my heroku log is attached. can someone please help me to suss it out?
thanks.
Attachments:
http://www.ruby-forum.com/attachment/6643/heroku.error
--
Posted via http://www.ruby-forum.com/.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.