Skip to content

Commit f5f2564

Browse files
committed
Changing enum in models due to Rails 8 signature changes
1 parent 81c1886 commit f5f2564

5 files changed

Lines changed: 9 additions & 13 deletions

File tree

app/models/hyrax/operation.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ class Operation < ActiveRecord::Base
77
FAILURE = 'failure'
88
SUCCESS = 'success'
99

10-
enum(
11-
status: {
10+
enum :status,
11+
{
1212
FAILURE => FAILURE,
1313
PENDING => PENDING,
1414
PERFORMING => PERFORMING,
1515
SUCCESS => SUCCESS
1616
}
17-
)
1817

1918
self.table_name = 'curation_concerns_operations'
2019
acts_as_nested_set

app/models/hyrax/permission_template_access.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ class PermissionTemplateAccess < ActiveRecord::Base
1818
GROUP = 'group'
1919
USER = 'user'
2020

21-
enum(
22-
access: {
21+
enum :access,
22+
{
2323
VIEW => VIEW,
2424
DEPOSIT => DEPOSIT,
2525
MANAGE => MANAGE
2626
}
27-
)
2827

2928
# @api public
3029
#

app/models/proxy_deposit_request.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,13 @@ def send_request_transfer_message_as_part_of_update
118118
CANCELED = 'canceled'
119119
REJECTED = 'rejected'
120120

121-
enum(
122-
status: {
121+
enum :status,
122+
{
123123
ACCEPTED => ACCEPTED,
124124
CANCELED => CANCELED,
125125
PENDING => PENDING,
126126
REJECTED => REJECTED
127127
}
128-
)
129128

130129
# @param [TrueClass,FalseClass] reset (false) if true, reset the access controls. This revokes edit access from the depositor
131130
def transfer!(reset = false)

app/models/sipity/notification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Notification < ActiveRecord::Base
1818
NOTIFICATION_TYPE_EMAIL = 'email'
1919

2020
# TODO: There are other types, but for now, we are assuming just emails to send.
21-
enum(notification_type: { NOTIFICATION_TYPE_EMAIL => NOTIFICATION_TYPE_EMAIL })
21+
enum :notification_type, { NOTIFICATION_TYPE_EMAIL => NOTIFICATION_TYPE_EMAIL }
2222

2323
def self.valid_notification_types
2424
notification_types.keys

app/models/sipity/notification_recipient.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ class NotificationRecipient < ActiveRecord::Base
77
belongs_to :notification, class_name: 'Sipity::Notification'
88
belongs_to :role, class_name: 'Sipity::Role'
99

10-
enum(
11-
recipient_strategy: {
10+
enum :recipient_strategy,
11+
{
1212
'to' => 'to',
1313
'cc' => 'cc',
1414
'bcc' => 'bcc'
1515
}
16-
)
1716
end
1817
end

0 commit comments

Comments
 (0)