Skip to content

Commit 2ec1695

Browse files
committed
Update several null_value fixers to be explicit
1 parent 432f314 commit 2ec1695

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/block_kit/composition/option.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Option < Base
2323
fixes :value, truncate: {maximum: MAX_VALUE_LENGTH, dangerous: true}
2424

2525
validates :description, presence: true, length: {maximum: MAX_DESCRIPTION_LENGTH}, allow_nil: true
26-
fixes :description, truncate: {maximum: MAX_DESCRIPTION_LENGTH}, null_value: [:blank]
26+
fixes :description, truncate: {maximum: MAX_DESCRIPTION_LENGTH}, null_value: {error_types: [:blank]}
2727

2828
def self.inherited(subclass)
2929
subclass.attribute_fixers = attribute_fixers.deep_dup

lib/block_kit/composition/overflow_option.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class OverflowOption < Option
1111

1212
attribute :url, :string
1313
validates :url, presence: true, format: {with: URI::DEFAULT_PARSER.make_regexp, message: "is not a valid URI", allow_blank: true}, length: {maximum: MAX_URL_LENGTH}, allow_nil: true
14-
fixes :url, truncate: {maximum: MAX_URL_LENGTH, dangerous: true, omission: ""}, null_value: [:blank]
14+
fixes :url, truncate: {maximum: MAX_URL_LENGTH, dangerous: true, omission: ""}, null_value: {error_types: [:blank]}
1515

1616
def as_json(*)
1717
super.merge(url: url).compact

lib/block_kit/composition/slack_file.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ class SlackFile < Base
1313
attribute :url, :string
1414

1515
validates :id, presence: true, format: {with: /\AF[A-Z0-9]{8,}\z/, allow_blank: true}, allow_nil: true
16-
fixes :id, null_value: [:blank]
16+
fixes :id, null_value: {error_types: [:blank]}
1717

1818
validates :url, presence: true, length: {maximum: MAX_URL_LENGTH}, format: {with: URI::DEFAULT_PARSER.make_regexp(%w[http https]), message: "is not a valid URI", allow_blank: true}, allow_nil: true
19-
fixes :url, null_value: [:blank]
19+
fixes :url, null_value: {error_types: [:blank]}
2020

2121
validate :id_or_url_present
2222

lib/block_kit/composition/trigger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Trigger < Base
1414

1515
validates :url, presence: true, length: {maximum: MAX_URL_LENGTH}, format: {with: URI::DEFAULT_PARSER.make_regexp(%w[http https]), message: "is not a valid URI", allow_blank: true}
1616
validates :customizable_input_parameters, presence: true, "block_kit/validators/associated": true, allow_nil: true
17-
fixes :customizable_input_parameters, null_value: [:blank]
17+
fixes :customizable_input_parameters, null_value: {error_types: [:blank]}
1818

1919
dsl_method :customizable_input_parameters, as: :customizable_input_parameter, required_fields: [:name, :value], yields: false
2020

0 commit comments

Comments
 (0)