Skip to content

Rename open_access to open_access_upload on WorkVersion#1996

Merged
Alex Kiessling (ajkiessl) merged 8 commits into
mainfrom
1976-rename-open-access-to-open-access-upload
Jun 11, 2026
Merged

Rename open_access to open_access_upload on WorkVersion#1996
Alex Kiessling (ajkiessl) merged 8 commits into
mainfrom
1976-rename-open-access-to-open-access-upload

Conversation

@karthikreddy-02

Copy link
Copy Markdown
Contributor

Renames the open_access boolean column on WorkVersion to open_access_upload to avoid conflicts with the existing open_access? method on the Permissions concern, which checks access controls and is unrelated to this field.

Changes:

Migration to rename the column
Updated all references across models, forms, controllers, and views
Added explicit open_access_upload? helper method on WorkVersion
Updated all affected specs
Note: The open_access? method in app/models/concerns/permissions.rb was intentionally left unchanged as it checks ACL-based visibility and is unrelated to this column.

@ajkiessl Alex Kiessling (ajkiessl) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. The only issue here is that the db/schema got a little messed up. This tends to happen locally for some reason. I explain what needs reverted below 👇

Comment thread db/schema.rb
ActiveRecord::Schema[7.2].define(version: 2026_04_28_182459) do
ActiveRecord::Schema[7.2].define(version: 2026_06_04_000000) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"

@ajkiessl Alex Kiessling (ajkiessl) Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable_extension "pg_stat_statements" needs added back in.

Comment thread db/schema.rb Outdated
create_table "versions", force: :cascade do |t|
t.string "item_type", null: false
t.string "item_type"
t.string "{null: false}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs reverted too.

…? helper

Resolved merge conflicts in work_version.rb and work_version_spec.rb by taking
main's version (WorkPublishedWebhookJob moved to publish_controller).
Fixed four new open_access column references introduced via main's OA workflow
additions. Restored open_access_upload? helper method and its tests.
Comment thread app/models/work_version.rb Outdated
Comment on lines +396 to +398
def open_access_upload?
open_access_upload == true
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think Rails automatically gives us this method for booleans. So, you can remove this and either implement open_access_upload? in all the places like: work_version.open_access_upload, or just leave the implementations as they are.

These references to the old open_access column name were introduced by
the open access workflow code merged from main and missed during the
initial rename.
…heckbox

The checkbox id was renamed to open_access_upload_checkbox but the label
for attribute and several feature specs still referenced the old
open_access_checkbox id.

@ajkiessl Alex Kiessling (ajkiessl) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ajkiessl Alex Kiessling (ajkiessl) merged commit cd598fc into main Jun 11, 2026
1 check passed
@ajkiessl Alex Kiessling (ajkiessl) deleted the 1976-rename-open-access-to-open-access-upload branch June 11, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants