Skip to content

Instantly share code, notes, and snippets.

View elrayle's full-sized avatar

E. Lynette Rayle elrayle

View GitHub Profile
@elrayle
elrayle / hyrax_closed_issues_2022-01-24_thru_2022-03-23.md
Created March 23, 2022 20:00
Hyrax Issues closed between 2022-01-24 thru 2022-03-23

All Issues

  • Issue 5470 - Bug: ActionController::InvalidAuthenticityToken in Hyrax::Dashboard::CollectionsController#update when updating banner. (closed: 2022-03-14)
  • Issue 4788 - Hyrax::Works do not show thumbnail in Dashboard -> Works (closed: 2022-03-15)
  • Issue 2259 - valid_delete? for permission_template_access should allow delete for :view and :deposit access (closed: 2022-03-09)
  • Issue 5563 - Index admin set relationship using the same field as ActiveFedora-based works (closed: 2022-03-22) See PR 5563 (merged: 2022-03-22 21:19:16 UTC)
  • Issue 5497 - Hyrax::AdministrativeSet shows 0 Total Items and No entries found under Works in This Set when it has works (closed: 2022-03-22)
  • [Issue 5493](https:
--> #0 #<Class:RSpec::Support::AllExceptionsExceptOnesWeMustNotRescue>.===(exception#FrozenError) at /Users/elr37/Documents/__DEVELOPMENT__/Samvera/sprint/hyrax/vendor/bundle/ruby/2.7.0/gems/rspec-support-3.9.4/lib/rspec/support.rb:138
#1 rescue in RSpec::Core::Example.rescue in block in run(example_group_instance#RSpec::ExampleGroups::HyraxCollectionMembershipValidator::Validate::WhenRecordIsAWorkFormChangeset::AndWorkIsAddedToCollections, reporter#RSpec::Core::Reporter) at /Users/elr37/Documents/__DEVELOPMENT__/Samvera/sprint/hyrax/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.3/lib/rspec/core/example.rb:271
#2 block in RSpec::Core::Example.block in run(example_group_instance#RSpec::ExampleGroups::HyraxCollectionMembershipValidator::Validate::WhenRecordIsAWorkFormChangeset::AndWorkIsAddedToCollections, reporter#RSpec::Core::Reporter) at /Users/elr37/Documents/__DEVELOPMENT__/Samvera/sprint/hyrax/vendor/bundle/ruby/2.7.0/gems/rspec-core-3.9.3/lib/rspec/core/example.rb:271
#3 block in RSpec::Co
@elrayle
elrayle / active_fedora_base_ext.rb
Created August 19, 2021 19:39
Allow AF or Valkyrie everywhere
def method_missing(method_name, *args, &block)
resource = self.valkyrie_resource
super unless resource.respond_to? method_name
resource.public_send(method_name, *arguments, &block)
end
@elrayle
elrayle / product_owner_note.txt
Created June 10, 2021 17:21
Note to product owner about renaming default branch
The Renaming Branch Working Group is in the process of renaming the default branch from `master` to `main` in Samvera and Samvera-Labs repos. This brings repositories into compliance with the Samvera Community Code of Conduct (https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct) and language recommendations (https://github.com/samvera/maintenance/blob/master/templates/CONTRIBUTING.md#language).
As the product owner for repository __________, we wanted to give you a heads up that the default branch name will be updated during the week of June 28, 2021. Background on the renaming effort is available in the working group notes (https://samvera.atlassian.net/wiki/x/b5IYHg).
Please reach out to anyone on in the working group if you have any questions.
Regards,
Branch Renaming Working Group
@elrayle
elrayle / issue.md
Last active June 8, 2021 19:54
Check for hard-coded legacy branch name references

Text for Issue:

Title

Update references of hard-coded legacy master branch name to main branch name

Description

### Descriptive summary
@elrayle
elrayle / config.yml
Created June 8, 2021 18:28
Circle CI step to fail if branch name is master
- run:
name: Check for a branch named 'master'
command: |
git fetch --all --quiet --prune --prune-tags
if [[ -n "$(git branch --all --list master */master)" ]]; then
echo "A branch named 'master' was found. Please remove it."
echo "$(git branch --all --list master */master)"
fi
[[ -z "$(git branch --all --list master */master)" ]]
payload = Hook['params']
branch_name = payload['ref']
repo_name = payload['repository']['fullname']
status = branch_name == "master" ? "BAD" : "GOOD"
puts "#{status} branch name #{branch_name}"
if status == "BAD"
puts "Deleting master branch from #{repo_name}"
# Wings (aka ActiveFedora) specific implementation that finds a publication given its unique identifier.
module CustomQueries
module Wings
class FindPublicationByIdentifier
# Define the queries that can be fulfilled by this custom query.
def self.queries
[:find_publication_by_identifier]
end
attr_reader :query_service
# Generated via
# `rails generate hyrax:work Publication`
# rubocop:disable Metrics/ClassLength
class Publication < ActiveFedora::Base
# This must come after the WorkBehavior because it finalizes the metadata
# schema (by adding accepts_nested_attributes)
include ::Hyrax::WorkBehavior
self.indexer = PublicationIndexer
@elrayle
elrayle / byebug_commands.md
Last active August 1, 2024 03:01
Byebug Cheatsheet - organized by related commands

Byebug Cheatsheet

This cheatsheet includes most of the byebug commands organized by related commands (e.g. breakpoint related commands are together).

To see official help...

Command Aliases Example Comments
help h h list top level of all commands
help cmd h cmd-alias h n list the details of a command (example shows requesting details for the next command) (this works for all commands)