Really no idea what's up...
class Auction < ActiveRecord::Base has_and_belongs_to_many :categories end
class Category < ActiveRecord::Base has_and_belongs_to_many :auctions
default_scope order('title') scope :active, where(:active => true) end
class CategoriesController < ApplicationController respond_to :html, :json
# GET /categories/:id def show @category = Category.where(:id => params[:id]).include(:auctions).first respond_with(@category) end
end
I receive the error:
undefined method `include' for :ActiveRecord::Relation
I have tried this on simple has_many relationships as well, and I get nothing but this error when trying to use .include