app/models/applications/application_for_offering.rb
# Defines setter methods for all questions in this Offering that are defined as dynamic answers.
# For checkbox, set answer with +offering_quesiton_option_id+ 
Defines setter methods for all questions in this Offering that are defined as dynamic answers.
For checkbox, set answer with +offering_quesiton_option_id+
Defines setter methods for all questions in this Offering that are defined as dynamic answers . For checkbox set answer with + offering_quesiton_option_id +
def define_dynamic_answer_setters!
    if offering
      offering.questions.find_all_by_dynamic_answer(true).each do |oq|
        if oq.display_as.include?("checkbox_options")
           oq.options.each do |option|
             self.class.send :define_method, "dynamic_answer_#{oq.id.to_s}_#{option.id.to_s}=", Proc.new {|argv| set_answer(oq.id, argv, option.id)}
           end        
        else
          self.class.send :define_method, "dynamic_answer_#{oq.id.to_s}=", Proc.new {|argv| set_answer(oq.id, argv)}
        end        
      end
    end
  end
def define_dynamic_answer_setters! if offering offering . questions . find_all_by_dynamic_answer ( true ) . each do | oq | if oq . display_as . include? ( "checkbox_options" ) oq . options . each do | option | self . class . send :define_method , "dynamic_answer_#{oq.id.to_s}_#{option.id.to_s}=" , Proc . new { | argv | set_answer ( oq . id , argv , option . id ) } end else self . class . send :define_method , "dynamic_answer_#{oq.id.to_s}=" , Proc . new { | argv | set_answer ( oq . id , argv ) } end end end end
Defines setter methods for all questions in this Offering that are defined as dynamic answers.
Defines setter methods for all questions in this Offering that are defined as dynamic answers .