jeudi 26 avril 2018

undefined method `name' for nil:NilClass block in skill_list

undefined method `name' for nil: NilClass block in skill_list Why is there the block in skill list? Do I need to call skiil_list some way?

def skill_list
    array = skill_associations.map do |sa|
     sa.skill.name
    end
   array.join(", ")
end

def skill_list=(names)
    self.skill_associations.delete_all
    self.skills = names.split(",").map do |m|
      Skill.where(name: m.strip).first_or_create!
    end
end

Aucun commentaire:

Enregistrer un commentaire