Source

main / app / models / funder_template.rb

Full commit
# == Schema Information
# Schema version: 20110617160839
#
# Table name: funder_templates
#
#  id         :integer         not null, primary key
#  funder_id  :integer
#  name       :string(255)
#  active     :boolean
#  startDate  :date
#  endDate    :date
#  created_at :datetime
#  updated_at :datetime
#

class FunderTemplate < ActiveRecord::Base
  attr_accessible :name

  has_many :plans
  has_many :question_templates
  has_many :questions, :through => :question_templates, :order => 'question_templates.question_order ASC'
  belongs_to :funder
  has_many :resource_contexts
  has_many :resources, through: :resource_contexts
  #has_one :link_resource, through: :resource_contexts, source: :resource, conditions: ['resource_contexts.question_id = ?', -1]
  #has_many :sample_plans, through: :resource_contexts, source: :resource, conditions: ['resource_contexts.question_id = ?', -2]
end