Skip to content

Commit

Permalink
use separate accessors instead of checking field_format against list …
Browse files Browse the repository at this point in the history
…in CustomField#multi_value_possible?
  • Loading branch information
toy committed Sep 12, 2024
1 parent 72bff94 commit 0b859db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/custom_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ def list?
field_format == "list"
end

def user?
field_format == "user"
end

def version?
field_format == "version"
end
Expand All @@ -281,7 +285,7 @@ def boolean?
end

def multi_value_possible?
%w[version user list].include?(field_format)
version? || user? || list?
end

def allow_non_open_versions_possible?
Expand Down

0 comments on commit 0b859db

Please sign in to comment.