Skip to content

Instantly share code, notes, and snippets.

@nomasprime
Created September 15, 2015 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nomasprime/9f87c01fc72fc2b9d185 to your computer and use it in GitHub Desktop.
Save nomasprime/9f87c01fc72fc2b9d185 to your computer and use it in GitHub Desktop.
class Survey < ActiveRecord::Base
acts_as_paranoid
include Importable
###### Associations ########
belongs_to :project
belongs_to :publication, counter_cache: true
belongs_to :site
belongs_to :location_type, :class_name => ListItem, :foreign_key => "location_type_id"
belongs_to :study_design, :class_name => ListItem, :foreign_key => "study_design_id"
belongs_to :intervention_status, :class_name => ListItem, :foreign_key => "intervention_status_id"
belongs_to :gender, :class_name => ListItem, :foreign_key => "gender_id"
belongs_to :time_of_day, :class_name => ListItem, :foreign_key => "time_of_day_id"
has_many :outcomes, dependent: :destroy
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment