noosfero | Use chartkick gem to improve the visualization of custom_form submissions. (!1316)

Rodrigo Souto gitlab at mg.gitlab.com
Thu Sep 28 10:02:19 BRT 2017


Rodrigo Souto started a new discussion on plugins/custom_forms/lib/custom_forms_plugin/graph.rb:

> +          self.send(show_as + "_answers", index, answer)
> +        end
> +      end
> +    end
> +  end
> +
> +  def check_box_answers(index, answer)
> +    list_of_answers = answer.value.split(",")
> +    list_of_answers.each do |answer_value|
> +      alternative_and_sum_of_answers = @answers_with_alternative_label[index][answer_value]
> +      alternative = alternative_and_sum_of_answers.keys.first
> +      @answers_with_alternative_label[index][answer_value][alternative] += 1
> +    end
> +  end
> +
> +  def select_answers(index, answer)

It's cleaner to use `alias_method` on these cases here.

---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1316#note_41776476
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170928/da84691b/attachment-0001.html>


More information about the Noosfero-dev mailing list