Sean Colquhoun wrote:
venueid = VenueClasses.find( :first, :conditions => [type =
What does "type = ?,params[:type]" do?
That's a typo for this:
[ " type => ? ", params[:type] ]
The ? just means to substitute in the next thing in the array.
(And _nobody_ here should be writing a Rails app without /Agile Web Development with Rails/ by the Daves. Don't let the "Agile" term spook you; they really mean "the easy way" there.)
This also works:
[ " type => :type ", params ]
Because then ActiveRecord treats the next item in the array as a Hash, and keys it with :type.
Also, the use of :include - from the API i got the impression that you
needed to use :joins first. So i guess I don't understand it yet.
If you mean a method takes two symbols, like this:
foo( :include => 42, :joins => 'bar' )
The method foo() might not use those arguments in that order. It might fetch the :joins key first.
Actually, this is my first time making a join in Rails. Is this the
right way to do it?
No, you should use the has_many directives, so they will take care of the verbose details for you.