Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a surveyor to create survey items for an id list #2340

Merged
merged 1 commit into from
Jul 11, 2016
Merged

Conversation

carolyncole
Copy link
Contributor

fixes #2133

Creates a Sufia::Migration::Survey::Item for each id passed into the call. If any id does not exists the entire call should fail.

The id list is generated by the code in #2335.

@projecthydra/sufia-code-reviewers

# @param [Array] id_list a list of ids to be surveyed
def call(id_list)
ActiveFedora::Base.find(id_list).each do |object|
Item.create(object_id: object.id, object_class: object.class, object_title: object.title, migration_status: -1)
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that meaning has been encoded in migration_status, but it's not clear to me what -1 represents.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to encode this in an ActiveRecord::Enum?

@awead
Copy link
Contributor

awead commented Jul 11, 2016

@Cam156 needs a rebase.

And adding enumerator for migration status
module Sufia
module Migration
module Survey
class Item < ActiveRecord::Base
enum migration_status: [:initial_state, :successful, :missing, :wrong_type]
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Much better!

@jcoyne jcoyne merged commit a100b37 into 6.x-stable Jul 11, 2016
@jcoyne jcoyne deleted the scm_2133 branch July 11, 2016 15:22
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.

None yet

3 participants