Skip to content

Commit

Permalink
Merge 8b7a063 into c3ceb23
Browse files Browse the repository at this point in the history
  • Loading branch information
carrickr committed Nov 30, 2016
2 parents c3ceb23 + 8b7a063 commit 2a02f8d
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,7 @@ ActiveFedora::Noid.configure do |config|
end
```

**NOTE 1**: If you switch to a new minter, it will not automatically start with the same state as the old minter. AF::Noid does include a couple of rake tasks for copying state from database-backed minters to file-backed ones and vice versa:

``` bash
# For migrating minter state from a file to a database
$ rake active_fedora:noid:migrate:file_to_database
# For migrating minter state from a database to a file
$ rake active_fedora:noid:migrate:database_to_file
```

**NOTE 2**: If you decide to use the database-backed minter, you may notice that your test suite now fails miserably if it is configured to clear out the application database between tests. If so, you may add the following to e.g. `spec/spec_helper.rb` to set the default minter in the test suite as the file-backed one:
Using the database-backed minter can cause problems with your test suite, where it is often sensible to wipe out database rows between tests (which destroys the database-backed minter's state, which renders it unusable). To deal with this and still get the benefits of using the database-backed minter in development and production environments, you'll also want to add the following helper to your `spec/spec_helper.rb`:

```ruby
require 'active_fedora/noid/rspec'
Expand All @@ -143,6 +134,21 @@ before(:suite) { disable_production_minter! }
after(:suite) { enable_production_minter! }
```

If you switch to the new database-backed minter and want to include in that minter the state of your current file-backed minter, AF::Noid 2.0.0 provides a new rake task that will copy your minter's state from the filesystem to the database:

```bash
$ rake active_fedora:noid:migrate:file_to_database
```

**NOTE 1**: If you switch to a new minter, it will not automatically start with the same state as the old minter. AF::Noid does include a couple of rake tasks for copying state from database-backed minters to file-backed ones and vice versa:

``` bash
# For migrating minter state from a file to a database
$ rake active_fedora:noid:migrate:file_to_database
# For migrating minter state from a database to a file
$ rake active_fedora:noid:migrate:database_to_file
```

### Identifier template

To override the default identifier pattern -- a nine-character string consisting of two alphanumeric digits, two numeric digits, two alphanumeric digits, two numeric digits, and a check digit -- put the following code in e.g. `config/initializers/active_fedora-noid.rb`:
Expand Down

0 comments on commit 2a02f8d

Please sign in to comment.