Sha256: bebbc597fe1eead7110bbf6ddb341d1ecf10571edb2ba2f52f39fef569995dc8

Contents?: true

Size: 430 Bytes

Versions: 63

Compression:

Stored size: 430 Bytes

Contents

module QuestionnairesControllable
  extend ActiveSupport::Concern

  private

  def convert_school_name_to_id(questionnaire)
    if questionnaire[:school_name]
      school = School.where(name: questionnaire[:school_name]).first
      school = School.create(name: questionnaire[:school_name]) if school.blank?
      questionnaire[:school_id] = school.id
      questionnaire.delete :school_name
    end
    questionnaire
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
hackathon_manager-0.3.0 app/controllers/concerns/questionnaires_controllable.rb
hackathon_manager-0.2.0 app/controllers/concerns/questionnaires_controllable.rb
hackathon_manager-0.1.0 app/controllers/concerns/questionnaires_controllable.rb