Select custom fields of public projects

pull/1455/head
Hagen Schink 11 years ago
parent f035d3f213
commit e12ec7883d
  1. 4
      app/models/work_package_custom_field.rb

@ -37,7 +37,9 @@ class WorkPackageCustomField < CustomField
joins("LEFT OUTER JOIN custom_fields_projects AS cfp ON (custom_fields.id = cfp.custom_field_id) " \
"LEFT OUTER JOIN projects AS p ON (cfp.project_id = p.id) " \
"LEFT OUTER JOIN members AS m ON (p.id = m.project_id)")
.where("custom_fields.is_for_all = #{ActiveRecord::Base.connection.quoted_true} OR m.user_id = ?", user.id)
.where("p.is_public = #{ActiveRecord::Base.connection.quoted_true} " \
"OR custom_fields.is_for_all = #{ActiveRecord::Base.connection.quoted_true} " \
"OR m.user_id = ?", user.id)
end
}

Loading…
Cancel
Save