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

Generating new concern changes primary_work_type #3006

Open
atz opened this issue Jan 10, 2017 · 2 comments
Open

Generating new concern changes primary_work_type #3006

atz opened this issue Jan 10, 2017 · 2 comments

Comments

@atz
Copy link
Contributor

atz commented Jan 10, 2017

The work_generator does:

      inject_into_file 'config/initializers/sufia.rb', after: "Sufia.config do |config|\n" do
        "  # Injected via `rails g sufia:work #{class_name}`\n" \
        "  config.register_curation_concern :#{file_name}\n"
      end

The important part there is that each work that gets generated is inserted above the others at the top of the config block, changing what primary_work_type returns (via .first).

I'm fairly confident that a user who generates a new type after years of stable operation would be surprised to find features behaving differently and code that suggests the new type is now "primary".

IMHO, we should get rid of primary_work_type altogether.

@atz
Copy link
Contributor Author

atz commented Jan 10, 2017

Shorter-term fix would be change the generator to append after any other already generated types.

@mjgiarlo
Copy link
Member

👍 to considering ditching primary_work_type. At a cursory glance, it's only used in a handful of spots in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants