diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-11-09 09:17:45 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-11-09 09:17:45 +0000 |
commit | 58b2d8e627253a258df75ba4bd52c6db98ac31ee (patch) | |
tree | 726965e9a4edf53d0464c1ab8e29f665bb7c2cf4 /app/models/custom_field.rb | |
parent | a4f3b8882d78b5b9ff0dcd67f8db9b3659bb1217 (diff) | |
download | redmine-58b2d8e627253a258df75ba4bd52c6db98ac31ee.tar.gz redmine-58b2d8e627253a258df75ba4bd52c6db98ac31ee.zip |
cleanup: rubocop: fix Layout/AlignArguments in app/models/custom_field.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18996 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/custom_field.rb')
-rw-r--r-- | app/models/custom_field.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index b65de2aa3..1802702bd 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -55,10 +55,11 @@ class CustomField < ActiveRecord::Base if user.admin? # nop elsif user.memberships.any? - where("#{table_name}.visible = ? OR #{table_name}.id IN (SELECT DISTINCT cfr.custom_field_id FROM #{Member.table_name} m" + - " INNER JOIN #{MemberRole.table_name} mr ON mr.member_id = m.id" + - " INNER JOIN #{table_name_prefix}custom_fields_roles#{table_name_suffix} cfr ON cfr.role_id = mr.role_id" + - " WHERE m.user_id = ?)", + where( + "#{table_name}.visible = ? OR #{table_name}.id IN (SELECT DISTINCT cfr.custom_field_id FROM #{Member.table_name} m" + + " INNER JOIN #{MemberRole.table_name} mr ON mr.member_id = m.id" + + " INNER JOIN #{table_name_prefix}custom_fields_roles#{table_name_suffix} cfr ON cfr.role_id = mr.role_id" + + " WHERE m.user_id = ?)", true, user.id) else where(:visible => true) @@ -68,7 +69,8 @@ class CustomField < ActiveRecord::Base visible? || user.admin? end - safe_attributes 'name', + safe_attributes( + 'name', 'field_format', 'possible_values', 'regexp', @@ -91,7 +93,7 @@ class CustomField < ActiveRecord::Base 'user_role', 'version_status', 'extensions_allowed', - 'full_width_layout' + 'full_width_layout') def format @format ||= Redmine::FieldFormat.find(field_format) |