Displaying 1 result from an estimated 1 matches for "find_current_company".
2007 Oct 26
3
Specing with Subdomains as Account Keys
...ler
def index
@items = @current_company.find_items(:all)
end
end
# company.rb
class Company < ActiveRecord::Base
has_many :items
def find_items(*args)
items.find(*args)
end
end
# application.rb
class ApplicationController < ActionController::Base
before_filter :find_current_company
def find_current_company
@current_company = Company.find_by_subdomain(account_subdomain)
end
end