Displaying 1 result from an estimated 1 matches for "find_all_act".
2008 Jul 19
0
undefined method `table_name'
...ative new to RoR - but I''m having a problem with some model
relationships that I thought should have worked. Hope someone can
help.
The code...
MODELS:
class Delivery < ActiveRecord::Base
 belongs_to :vehicle
end
class Vehicle < ActiveRecord::Base
 has_many :deliveries
 def self.find_all_active
   Vehicle.find(:all, :order => ''name'', :conditions => [''is_active
= ?'', true])
 end
end
CONTROLLER:
 @vehicles = Vehicle.find_all_active
VIEW:
 <%= vehicle.deliveries.length %>
The error...
undefined method `table_name'' for Delivery:...