Newer
Older
dmpopidor / app / models / theme.rb
@Damodar Damodar on 10 Aug 2016 554 bytes dropdown and org language setting
class Theme < ActiveRecord::Base

  #associations between tables
  has_and_belongs_to_many :questions, join_table: "questions_themes"  
  has_and_belongs_to_many :guidances, join_table: "themes_in_guidance"
  
  
#  accepts_nested_attributes_for :guidances
#  accepts_nested_attributes_for :questions
  
  attr_accessible :guidance_ids , :as => [:default, :admin]
  attr_accessible :question_ids, :as => [:default, :admin]
  attr_accessible :description, :title, :locale , :as => [:default, :admin]
  
  def to_s
  	title
  end
  
end