Skip to content

Commit

Permalink
see if rubocop will let me get away with not fixing all instances of …
Browse files Browse the repository at this point in the history
…ts()
  • Loading branch information
Cesium-Ice committed Sep 22, 2024
1 parent 047a875 commit 450dbeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def title
maximum: ArchiveConfig.SUMMARY_MAX,
too_long: ts("must be less than %{max} characters long.", max: ArchiveConfig.SUMMARY_MAX) }

validates :header_image_url, format: { allow_blank: true, with: URI::DEFAULT_PARSER.make_regexp(%w[http https]), message: ts("is not a valid URL.") }
validates :header_image_url, format: { allow_blank: true, with: /\A\S+\.(png|gif|jpg)\z/, message: ts("can only point to a gif, jpg, or png file."), multiline: true }
validates :header_image_url, format: { allow_blank: true, with: URI::DEFAULT_PARSER.make_regexp(%w[http https]), message: I18n.t("collection.header_image.invalid_url") }
validates :header_image_url, format: { allow_blank: true, with: /\A\S+\.(png|gif|jpg)\z/, message: I18n.t("collection.header_image.invalid_file_type"), multiline: true }

validates :tags_after_saving,
length: { maximum: ArchiveConfig.COLLECTION_TAGS_MAX,
Expand Down Expand Up @@ -207,7 +207,7 @@ def to_param
end

# Change membership of collection(s) from a particular pseud to the orphan account
def self.orphan(pseuds, collections, default=true)
def self.orphan(pseuds, collections, default = true)
pseuds.each do |pseud|
collections.each do |collection|
if pseud && collection && collection.owners.include?(pseud)
Expand Down
4 changes: 4 additions & 0 deletions config/locales/models/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ en:
other: Works
attributes:
ticket_number: Ticket ID
collection:
header_image:
invalid_file_type: can only point to a gif, jpg, or png file.
invalid_url: is not a valid URL.
errors:
attributes:
ticket_number:
Expand Down

0 comments on commit 450dbeb

Please sign in to comment.