Re: [Rails] Is Array constants in the model can be changed during runtime?

2014-02-03 Thread Marco Antonio Almeida
Hi, Constants in Ruby are "contantish". And in your case you're passing the array reference to job types, so any changes that you do in job_types it goes to ItServiceJob::TYPES. With that being said what you need to do is duplicate the ItServiceJob::TYPES. Change the job_type assignment with: jo

[Rails] Is Array constants in the model can be changed during runtime?

2014-02-03 Thread Роман Ярыгин
Hello everyone! I have strange problem. Here is the code: model: class ItServiceJob < ActiveRecord::Base TYPES = [["Important", 0], ["Not important", 1], ["SERGEY", 2]] belongs_to :userend view (haml): %div{:role => "main", :class => "ui-content"} - job_types = ItServic