task.rb
class Task < ActiveRecord:Base
belongs_to :product
belongs_to :shop
def taskables
[product, shop].compact
end
end
|
task_controller.rb
class TaskController < ApplicationController
def index
@tasks = Task.find(:all, :included => [:product, :shop])
end
end
|
