Skip to content

Commit

Permalink
placeholder for #292
Browse files Browse the repository at this point in the history
  • Loading branch information
sethaj committed Jul 13, 2016
1 parent 2061ffd commit 360036c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions app/models/minter_state.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
class MinterState < ActiveRecord::Base
validates :namespace, presence: true, uniqueness: true
validates :template, presence: true
validates :template, format: { with: Object.const_get('Noid::Template::VALID_PATTERN'), message: 'value fails regex' }

# @return [Hash] options for Noid::Minter.new
# * template [String] setting the identifier pattern
# * seq [Integer] reflecting minter position in sequence
# * counters [Array{Hash}] "buckets" each with :current and :max values
# * rand [Object] random number generator object
def noid_options
Rails.logger.debug("
app/model/minter_state.rb is a placeholder for active_fedora-noid-2.0.0.beta1/app/models/minter_state.rb
See: https://github.com/projecthydra-labs/active_fedora-noid/issues/29
Once active_fedora-noid-2.0.0 is out of beta, and CurationConcerns no longer requires it,
remove this file.
(This isn't actually used by heliotrope at all, it's just here to stop an initialization error in production)
See #292
")
return nil unless template
opts = {
template: template,
seq: seq
}
opts[:counters] = JSON.parse(counters, symbolize_names: true) if counters
opts[:rand] = Marshal.load(random) if random
opts
end
end

0 comments on commit 360036c

Please sign in to comment.