Sha256: ecd4e13bfa043481d12041d2b8db544d45a0e7e5ba55973bac7a7297179b567b

Contents?: true

Size: 505 Bytes

Versions: 6

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

class MinterState < ApplicationRecord
  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' }

  # Creates an initial row for the namespace.
  # @return [MinterState] the initial minter state
  def self.seed!(namespace:, template:)
    create!(
      namespace: namespace,
      template: template
    )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
noid-rails-3.2.0 app/models/minter_state.rb
noid-rails-3.1.0 app/models/minter_state.rb
noid-rails-3.0.3 app/models/minter_state.rb
noid-rails-3.0.2 app/models/minter_state.rb
noid-rails-3.0.1 app/models/minter_state.rb
noid-rails-3.0.0 app/models/minter_state.rb