fix_not_initialized_variable_in_query_model.patch

Bernhard Rohloff, 2018-03-07 16:59

Download (827 Bytes)

View differences:

app/models/query.rb (Arbeitskopie)
222 222
    errors.add(:base, l(:label_role_plural) + ' ' + l('activerecord.errors.messages.blank')) if query.visibility == VISIBILITY_ROLES && roles.blank?
223 223
  end
224 224

  
225
  after_initialize :set_global_attribute
225 226
  after_save do |query|
226 227
    if query.saved_change_to_visibility? && query.visibility != VISIBILITY_ROLES
227 228
      query.roles.clear
......
359 360
    @queried_table_name ||= self.class.queried_class.table_name
360 361
  end
361 362

  
362
  def initialize(attributes=nil, *args)
363
    super attributes
364
    @is_for_all = project.nil?
363
  def set_global_attribute
364
	@is_for_all = project.nil?
365 365
  end
366 366

  
367 367
  # Builds the query from the given params