-
Notifications
You must be signed in to change notification settings - Fork 4
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
Dummy works rake task #512
Conversation
I am getting an error when running the task:
Note that I'm not running it with a clean database -- should that make a difference? There is no |
Adding those missing folders seems to have resolved the issue, so I imagine you might just need to commit them with a |
Some interesting behavior here:
I tested this with a clean database/Solr index/Fedora instance, and I'm still seeing this behavior. Here are the steps I used to set up the instance (while in the app container as the
I can still edit a work I create in the UI, and I can't immediately see anything in the metadata (as viewed in the Rails console) that would identify a difference in permissions between these two works. Also, I'm noting that in the default behavior -- even in production -- when creating an ETD is not to assign it to the ETDs admin set. It may be possible by passing |
Ah! It's not editable because the For closing this PR, I'd recommend a) adding the empty directories and b) populating the license field in the method(s) that create the works. The issue of ETDs not being added to the ETD admin set seems like a separate issue. I'll create a ticket for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See suggestions in my previous comment.
Got it! Thanks for taking a look - will make these changes. |
I'm making those adjustments to this now and have a question. The way I had it set up, it just finds the first admin user in the database and has that user as the creator for the dummy works - admin_user = Role.find_by(name: "admin").users.first. I think I could change it to also take an email address as an argument, check if that user is in the database and also an admin, and if so - set that to be the user used in the rake task for creating the works. If that user isn't in the DB or isn't an admin, would just have it throw an error and exit the task with explanation. Do you think that change makes sense? |
@alepbloyd I think that change makes sense -- thanks! |
Cool cool - made those changes:
|
Adds a rake task for generating dummy works for development convenience, and removes old dummy files used for testing - using Prawn gem to generate simple PDFs instead, which is more flexible.
Takes optional arguments of
public_works
,private_works
, andauthenticated_works
with integers. For example:This would run in the
production
environment, and the firstadmin
user would create 4 public works, 2 works private to that admin, and 3 authenticated works visible to logged in users. You can also omit any of these arguments and it will be assumed that you mean 0.