Project

General

Profile

Defect #28264 » fix_not_initialized_variable_in_query_model.patch

Bernhard Rohloff, 2018-03-07 16:59

View differences:

app/models/query.rb (Arbeitskopie)
errors.add(:base, l(:label_role_plural) + ' ' + l('activerecord.errors.messages.blank')) if query.visibility == VISIBILITY_ROLES && roles.blank?
end
after_initialize :set_global_attribute
after_save do |query|
if query.saved_change_to_visibility? && query.visibility != VISIBILITY_ROLES
query.roles.clear
......
@queried_table_name ||= self.class.queried_class.table_name
end
def initialize(attributes=nil, *args)
super attributes
@is_for_all = project.nil?
def set_global_attribute
@is_for_all = project.nil?
end
# Builds the query from the given params
(2-2/3)