On Fri, Sep 02, 2011 at 02:27:10PM +0200, Tomas Sedovic wrote:
Generally, this looks good but I've had two issues.
First, the migration was failing for me anyway (I created some suggested
deployables to test this). The migration you fixed is run before the one
that adds the Catalogs table. So calls like `Catalog.first` don't work.
To test it further, I renamed my the migration files so that
`create_catalogs.rb`
is run before `renamed_suggested_deployable_to_catalog_entries.rb`.
That did the trick -- migrations passed.
But then I went to the UI for Catalog and Catalog Entries and both were
empty.
When I looked them up in `rails console`, everything seemed to be all right.
I'm pretty certain that this is because db/seeds.rb adds Catalog
permissions to the Admin role, but when you seed the database earlier
and then run migrations, the permissions are not added automatically.
And you can't re-run `rake db:seeds` to update it.
I'm not sure how important this is, but if this should be fixed, you can
look at my recent Hardware Profile Permissions patch. I had to solve a
similar problem (adding permissions through a migration) there.
Thanks, as always, for the careful review.
I think it's important enough to fix this experience, so I did so. It
ended up being a pain, and the result was a 75-line migration and a
migraine, but it works. I'll send the patch as a reply to this.
-- Matt