Displaying 1 result from an estimated 1 matches for "find_all_by_regatta_id".
2007 Oct 15
0
converting from HABTM to has_many :through
...en it gets included
in a regatta. But for now I''m just trying to get back to the same
functionality I had when it was a HABTM relationship, and there was no
"include" model. So, here is what the update method looks like now:
@regatta = Regatta.find(params[:id])
Inclusion.find_all_by_regatta_id(params[:id]).each { |i|
boat_class = i.boat_class
if params[:boat_classes]
i.included = params[:boat_classes].include? boat_class.id
params[:boat_classes].delete boat_class.id
else
i.included = false
end
flash[:notice] = ...