Skip to content

Commit

Permalink
Merge pull request #3576 from ualbertalib/dependabot/bundler/main/rub…
Browse files Browse the repository at this point in the history
…ocop-rails-2.26.2

Bump rubocop-rails from 2.25.1 to 2.26.2
  • Loading branch information
pgwillia authored Oct 21, 2024
2 parents 95e8f34 + b0e3a0a commit 7f236b6
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 36 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ New entries in this file should aim to provide a meaningful amount of informatio

## [Unreleased]

### Changed ###
* Rails/EnumSyntax: Enum defined with keyword arguments in enum declarations. Use positional arguments instead. [PR#3576](https://github.com/ualbertalib/jupiter/pull/3576)


## [2.10.0] - Unreleased

:warning: Updated requirement **Node.js** 18.15.0+
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,10 @@ GEM
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.25.1)
rubocop-rails (2.26.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
ruby-saml (1.17.0)
Expand Down
2 changes: 1 addition & 1 deletion app/models/batch_ingest.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class BatchIngest < ApplicationRecord

enum status: { created: 0, processing: 1, completed: 2, failed: 3 }
enum :status, { created: 0, processing: 1, completed: 2, failed: 3 }

belongs_to :user

Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/draft_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module DraftProperties
# inactive: Draft objects where the user never passed first step of deposit wizard.
# active: Draft objects where the user made it passed first step, but hasn't finished completing the deposit wizard.
# archived: Draft objects that have been "published" where a user has successfully deposited and completed the deposit wizard.
enum status: { inactive: 0, active: 1, archived: 2 }
enum :status, { inactive: 0, active: 1, archived: 2 }

# Note that dependent: false is necessary here as Items and DraftItems can both have ActiveStorage::Attachment records
# that point at the same underlying blob record. See Item#from_draft.
Expand Down
2 changes: 1 addition & 1 deletion app/models/digitization/batch_metadata_ingest.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Digitization::BatchMetadataIngest < ApplicationRecord

enum status: { created: 0, processing: 1, completed: 2, failed: 3 }
enum :status, { created: 0, processing: 1, completed: 2, failed: 3 }

belongs_to :user

Expand Down
50 changes: 25 additions & 25 deletions app/models/draft_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ class DraftItem < ApplicationRecord

include DraftProperties

enum wizard_step: { describe_item: 0,
choose_license_and_visibility: 1,
upload_files: 2,
review_and_deposit_item: 3 }

enum license: { attribution_non_commercial: 0,
attribution: 1,
attribution_non_commercial_no_derivatives: 2,
attribution_non_commercial_share_alike: 3,
attribution_no_derivatives: 4,
attribution_share_alike: 5,
cco_universal: 6,
public_domain_mark: 7,
license_text: 8,
attribution_3_0: 9,
attribution_non_commercial_3_0: 10,
attribution_share_alike_3_0: 11,
attribution_non_commercial_no_derivatives_3_0: 12,
attribution_non_commercial_share_alike_2_5: 13,
unselected: 14 }
enum :wizard_step, { describe_item: 0,
choose_license_and_visibility: 1,
upload_files: 2,
review_and_deposit_item: 3 }

enum :license, { attribution_non_commercial: 0,
attribution: 1,
attribution_non_commercial_no_derivatives: 2,
attribution_non_commercial_share_alike: 3,
attribution_no_derivatives: 4,
attribution_share_alike: 5,
cco_universal: 6,
public_domain_mark: 7,
license_text: 8,
attribution_3_0: 9,
attribution_non_commercial_3_0: 10,
attribution_share_alike_3_0: 11,
attribution_non_commercial_no_derivatives_3_0: 12,
attribution_non_commercial_share_alike_2_5: 13,
unselected: 14 }
LICENSE_TO_URI_CODE =
{ attribution_non_commercial: :attribution_noncommercial_4_0_international,
attribution: :attribution_4_0_international,
Expand All @@ -39,9 +39,9 @@ class DraftItem < ApplicationRecord
URI_CODE_TO_LICENSE = LICENSE_TO_URI_CODE.invert

# Can't use public as this is a ActiveRecord method, using open_access instead
enum visibility: { open_access: 0,
embargo: 1,
authenticated: 2 }
enum :visibility, { open_access: 0,
embargo: 1,
authenticated: 2 }

VISIBILITY_TO_URI_CODE = { open_access: :public,
embargo: :embargo,
Expand All @@ -54,8 +54,8 @@ class DraftItem < ApplicationRecord
# By default it will always be in `public`/`opened` status
# Only needed for for the odd chance they want to change an item's visibility_after_embargo
# to `ccid_authenticated`/`authenticated` from the console
enum visibility_after_embargo: { opened: 0,
ccid_protected: 1 }
enum :visibility_after_embargo, { opened: 0,
ccid_protected: 1 }

VISIBILITY_AFTER_EMBARGO_TO_URI_CODE = { opened: :public,
ccid_protected: :authenticated }.freeze
Expand Down
12 changes: 6 additions & 6 deletions app/models/draft_thesis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ class DraftThesis < ApplicationRecord
[I18n.t('admin.theses.graduation_terms.fall'), '11']
].freeze

enum wizard_step: { describe_thesis: 0,
choose_license_and_visibility: 1,
upload_files: 2,
review_and_deposit_thesis: 3 }
enum :wizard_step, { describe_thesis: 0,
choose_license_and_visibility: 1,
upload_files: 2,
review_and_deposit_thesis: 3 }

# Can't use public as this is a ActiveRecord method, using open_access instead
enum visibility: { open_access: 0,
embargo: 1 }
enum :visibility, { open_access: 0,
embargo: 1 }

VISIBILITY_TO_URI_CODE = { open_access: :public,
embargo: :embargo }.freeze
Expand Down

0 comments on commit 7f236b6

Please sign in to comment.