Skip to content

Commit

Permalink
Indicate WP subject as non-writable when generated
Browse files Browse the repository at this point in the history
Automatic subject generation should prevent users from
editing the subject directly. Instead it can only be updated
automatically, when other fields change in that case.
  • Loading branch information
NobodysNightmare committed Jan 7, 2025
1 parent 58eae05 commit f254330
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def initialize(schema, self_link:, **context)
schema :subject,
type: "String",
min_length: 1,
max_length: 255
max_length: 255,
writable: ->(*) { default_writable_property(:subject) && !represented.type&.replacement_pattern_defined_for?(:subject) }

Check notice on line 120 in lib/api/v3/work_packages/schema/work_package_schema_representer.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] lib/api/v3/work_packages/schema/work_package_schema_representer.rb#L120 <Layout/LineLength>

Line is too long. [137/130]
Raw output
lib/api/v3/work_packages/schema/work_package_schema_representer.rb:120:131: C: Layout/LineLength: Line is too long. [137/130]

schema :description,
type: "Formattable",
Expand Down

0 comments on commit f254330

Please sign in to comment.