0001-Remove-unused-and-broken-method-CustomField.visibili.patch

Holger Just, 2018-06-29 14:47

Download (1.11 KB)

View differences:

app/models/custom_field.rb
224 224
    end
225 225
  end
226 226

  
227
  def self.visibility_condition
228
    if user.admin?
229
      "1=1"
230
    elsif user.anonymous?
231
      "#{table_name}.visible"
232
    else
233
      "#{project_key} IN (SELECT DISTINCT m.project_id FROM #{Member.table_name} m" +
234
        " INNER JOIN #{MemberRole.table_name} mr ON mr.member_id = m.id" +
235
        " INNER JOIN #{table_name_prefix}custom_fields_roles#{table_name_suffix} cfr ON cfr.role_id = mr.role_id" +
236
        " WHERE m.user_id = #{user.id} AND cfr.custom_field_id = #{id})"
237
    end
238
  end
239

  
240 227
  def <=>(field)
241 228
    position <=> field.position
242 229
  end
243
-